Script for Killing Process in Windows

Ristogod

Well-known member
Don't know much about writing scripts that work in Windows. I need a script that will kill a process when I click on it. For instance, if "firefox.exe" is running, I would like something I could just click and it would kill that process. Anyone know how to do this?

I've googled, but didn't find really what I wanted and am just looking for a quick and easy way to get my end result.
 
This is what I used to use to play UT2004.

taskkill /F /IM explorer.exe
taskkill /F /IM avgcc.exe
taskkill /F /IM RegTwk.exe
taskkill /F /IM fmempro.exe

start /wait D:\UT2004\System\UT2004.exe

start C:\Windows\explorer.exe
start D:\Program Files\Grisoft\AVG Free\avgcc.exe
start C:\Program Files\rage3dtweak\RegTwk.exe
start C:\Program Files\FreeMem Professional\fmempro.exe

Paste what you want to a note pad txt file rename .bat and you have a batch file for killing and relaunch programs.
hope that helps.

You can make 2 batch files up one to kill one to restart.
If you kill explorer its a good idea to have an all in one so it starts up again.
 
Last edited:
Killing explorer seems a bit drastic :D

But yeah, batch scripts are the way to go.



If you want to just do basic stuff, like running an application with a predefined set of flags, you can make a shortcut, open up properties, and set the flags from there.
 
ristogod said:
Don't know much about writing scripts that work in Windows. I need a script that will kill a process when I click on it. For instance, if "firefox.exe" is running, I would like something I could just click and it would kill that process. Anyone know how to do this?

I've googled, but didn't find really what I wanted and am just looking for a quick and easy way to get my end result.

Could you be a little more specific? I can understand a script for automating the ending of an app but if you're going to actually click on it, then why is clicking the close (x) button not an option? it seems to be more work. Do you really want to kill the process, close the window, or end the app? These are all different actions and are all possible.
 
Synetech said:
Could you be a little more specific? I can understand a script for automating the ending of an app but if you're going to actually click on it, then why is clicking the close (x) button not an option? it seems to be more work. Do you really want to kill the process, close the window, or end the app? These are all different actions and are all possible.


I do a lot of web applicaton programming where I work. The latest thing I'm working on tends to lock up Firefox completely where I have to close it using task manager. Clicking the [X] doesn't work when the program isn't responding.
 
Why does this window stay around?



This is the batch file I'm trying to use.

Code:
taskkill /F /IM firefox.exe

start /wait C:\Progra~1\Mozill~1\firefox.exe


Synetech said:
Put it in double quotes, eg: "C:\Program Files\Mozilla Firefox"

All this does is give me two open command prompt windows and doesn't start Firefox???



EDIT: Why doesn't my image show up in the thread?
 
Last edited:
Back
Top