Ever have a whole bunch of programs open on your Windows PC and wish you could just kill the process of all of them? Although there are some freeware programs out to help you do that, here’s a homebrew way provided by helpful advice from the USENET community on how to do it yourself.
What we’ll do is use the taskkill command with a bunch of custom arguments that specify to kill everything other than Explorer—but you can really customize it to anything you’d like, and keep in mind you should really read this carefully before proceeding.
The first thing you’ll want to do is open up a command prompt by going to your start menu, click run and type “cmd”. Once it ups, then type:
and press enter. You can see the syntax with loads of options!
We’ll be using a couple of operators to accomplish what we want, including these two:
- /F – force closes the applications (this is optional, keep in mind force closing will lose unsaved data)
- /FI – uses a filter, which is where the magic is
Now it’s time to put them together. For example, if you wanted to kill every app by your username, you’d use taskkill like this to check where your username is “eq” (equal) to geek.
taskkill /F /FI “USERNAME eq geek”
The only problem with this is that it would also kill explorer.exe and dwm.exe, so your whole screen would flash and the Start Menu would completely disappear—probably not what you want.
Thankfully we can chain together multiple instances of the /FI argument to fix this problem, and we’ll use the IMAGENAME, which is the name of the executable, and the “ne” for “Not Equal” to the ones we don’t want to kill.
taskkill /F /FI “USERNAME eq geek” /FI “IMAGENAME ne explorer.exe” /FI “IMAGENAME ne dwm.exe”
You can customize this even further if you’d like, adding extra processes that you don’t want to close into the list. It’s really up to you—just keep in mind that if you accidentally kill Explorer.exe you can always use Ctrl+Shift+Esc to open Task Manager, and restart the process from the File –> Run menu.
Note: if you don’t want to force kill the applications, you should remove the /F argument.
Once you’ve got the command figured out, it’s easy enough to create the shortcut—just right-click anywhere and choose New Shortcut. Once you’re there, drop the full command into the location box.
Give it an icon and put the shortcut somewhere, and you’re all done. Now you can kill everything in one shortcut, with no added software!
You can do this with certain applications only too. Want to have a shortcut to force kill a application and then start it again easily?
Create a new Text Document (.txt file) and change the extension to .bat
Open it in Notepad and paste:
taskkill /im firefox.exe /f
start “C:\Program Files\Mozilla Firefox\firefox.exe”
That would be an example with Firefox, but you can change it to what ever program you like as long as you have the path to the program correctly.
Note: Use of this shortcut should be done at your own risk, and if your computer explodes don’t blame us. We warned you.