AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to kill a batch command?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Calibran
Guest





PostPosted: Wed Dec 17, 2008 3:13 pm    Post subject: How to kill a batch command? Reply with quote

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





PostPosted: Wed Dec 17, 2008 3:23 pm    Post subject: Re: How to kill a batch command? Reply with quote

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. Wink
Back to top
Obi-Wahn



Joined: 20 Apr 2006
Posts: 75
Location: Vienna

PostPosted: Wed Dec 17, 2008 3:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Calibran
Guest





PostPosted: Wed Dec 17, 2008 4:04 pm    Post subject: Reply with quote

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





PostPosted: Wed Dec 17, 2008 4:09 pm    Post subject: Reply with quote

Correction!
Untested Guest you got it right. Forgot the % %. Now works fine.
Many thanks
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group