| View previous topic :: View next topic |
| Author |
Message |
Calibran Guest
|
Posted: Wed Dec 17, 2008 3:13 pm Post subject: How to kill a batch command? |
|
|
Is there a way to kill a batch process? Because killing a 'Script.bat' doesn't stop the dos commands it contains from running to their end.
Any idea folks? |
|
| Back to top |
|
 |
untested guest Guest
|
Posted: Wed Dec 17, 2008 3:23 pm Post subject: Re: How to kill a batch command? |
|
|
Completely untested, but it might work
| Code: | ; start the batch file
Run. %comspec% script.bat,,,runPID
;then to kill it:
Process, Close, %runPID% |
Let us know if it works.  |
|
| Back to top |
|
 |
Obi-Wahn
Joined: 20 Apr 2006 Posts: 75 Location: Vienna
|
Posted: Wed Dec 17, 2008 3:30 pm Post subject: |
|
|
If the batch window is visible send Ctrl+c to the command window. You may have also to send j (for Ja [im German]) and {Enter} to the window to confirm batch abort.
But maybe there's something wrong with the batch, when it runs to nowhere but shouldn't?!? |
|
| Back to top |
|
 |
Calibran Guest
|
Posted: Wed Dec 17, 2008 4:04 pm Post subject: |
|
|
Folks, I appreciate your input, feels like I belong.
Untested Guest, even though it seems an obvious move, it doesn't work, doesn't kill the cmd process.
Obi-Wahn, you make sense as well, but my dos window is hidden.
I've worked around it with:
| Code: |
Process, Close, cmd.exe
|
That's lethal
Thanks for your help |
|
| Back to top |
|
 |
Calibran Guest
|
Posted: Wed Dec 17, 2008 4:09 pm Post subject: |
|
|
Correction!
Untested Guest you got it right. Forgot the % %. Now works fine.
Many thanks |
|
| Back to top |
|
 |
|