hi to all,
I would need to have a main slow repeating process inside a loop to make it running or stop it.
The batch idea to use a set /p on top or bottom of the loop, waiting for a key to stop, is good but as process itself could last hours i do not know if keyboard cue is read during the steady u.i. time.
Another way of stopping is CNTR+C,Y,ENTER but it kills the process and loose all temporary stored data by the process.
Among the two the latter is good in contingency, but the sequence is long, do there is any code example to substitute it?
Also, if i remember well, dos choice was able to create a shell for processes waiting a single keypress to escape from it, another way of implementing.
Any suggestion?
Thanks
CNTR+C,Y,ENTER programmatically equivalent
Moderator: DosItHelp
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: CNTR+C,Y,ENTER programmatically equivalent
I don't understand well what you mean, but you might try WshShell's SendKeys method through VBScript.
Re: CNTR+C,Y,ENTER programmatically equivalent
Me too, , i am not in my mother language, beg pardon
Actually: what if you have a repeating process that takes 20min to complete each run and you want to stop before it starts again with another instance?
My guess:(1) use the set /p or combination of goto and set /p to quit the loop at next iteration (2)use CNTR+C/Y/ENTER to quit immediately (3)use an alternate of msdos choice
Know problems:(for item 1)is not possible to have an acknowledgement of the iterations being quit at end of present run (2)actually CNT.. kills everything and leave the process as it never run or with not useful traces (3)msdos choice is evil, other have same functionality, but probably there are coding examples that avoid the use of machine language binaries.
Can someone give a suggestion? At least the coding to make <CNTR-C/Y/ENTER> programmacally, like <X/ENTER>
Adv. Thanks
Actually: what if you have a repeating process that takes 20min to complete each run and you want to stop before it starts again with another instance?
My guess:(1) use the set /p or combination of goto and set /p to quit the loop at next iteration (2)use CNTR+C/Y/ENTER to quit immediately (3)use an alternate of msdos choice
Know problems:(for item 1)is not possible to have an acknowledgement of the iterations being quit at end of present run (2)actually CNT.. kills everything and leave the process as it never run or with not useful traces (3)msdos choice is evil, other have same functionality, but probably there are coding examples that avoid the use of machine language binaries.
Can someone give a suggestion? At least the coding to make <CNTR-C/Y/ENTER> programmacally, like <X/ENTER>
Adv. Thanks
Re: CNTR+C,Y,ENTER programmatically equivalent
I don't understand you, maybe you should post the bit of script that you have already.
And explain it one step at a time because I'm no good in english, but you are worse
What is your mother language ?, just curious...
Are you looking for a way to enter keystokes, or ? waiting for a process to complete & then close it ?
And explain it one step at a time because I'm no good in english, but you are worse
What is your mother language ?, just curious...
Are you looking for a way to enter keystokes, or ? waiting for a process to complete & then close it ?
Re: CNTR+C,Y,ENTER programmatically equivalent
How about :-
Regards
Alan
Code: Select all
@ECHO OFF
:START
ECHO PRETEND THIS IS A LONG SLOW PROCESS
ECHO LONG SLOW PROCESS is now concluded and pausing
PAUSE
ECHO REPEAT LONG SLOW PROCESS
GOTO START
Regards
Alan