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 

Kill a process....

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





PostPosted: Sun Dec 20, 2009 9:08 pm    Post subject: Kill a process.... Reply with quote

How do I write a script that will kill a process by its process name?
I could write

Code:
run taskkill /f /im firefox.exe


but that will display the CMD prompt. I want to kill the process invisibly.
Back to top
guest2
Guest





PostPosted: Sun Dec 20, 2009 9:21 pm    Post subject: Reply with quote

this may help
http://www.autohotkey.com/forum/topic52458.html
Back to top
Micahs



Joined: 01 Dec 2006
Posts: 460

PostPosted: Sun Dec 20, 2009 10:05 pm    Post subject: Reply with quote

Code:
Process, Close, firefox.exe


This will close only the first instance if there are more than one. If you wanted to close all running instances, you could do this:
Code:
Loop
{   Process, Close, firefox.exe
   IfEqual, ErrorLevel, 0, Break   ;if out of targets, exit loop
}
MsgBox, done
If there is a problem with closing one instance, the loop will exit and the rest will not be closed, though. You could parse the list of running processes and close firefox.exe processes only.
_________________
Back to top
View user's profile Send private message
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