Create Quick-Kill Shortcuts for Runaway Applications
Posted by Adam Pash at 7:00 AM on December 14, 2007
Got an unstable application that you can't give up for whatever reason that also freezes up on you regularly? Weblog CyerNet details how to create quick-kill shortcuts for specific applications using either the built-in Windows command line tool taskkill, or a third-party command line tool called taskill (notice one less 'k'). With the default taskkill, just create a shortcut that runs the following:
taskkill /f /im firefox.exe Where firefox.exe is replaced by the the application you want to force to quit. Lastly, if you're a *nix user (Mac or Linux), you can use the killall command, so a similar command would look something like killall firefox-bin, though you can dig deeper when killing apps on your Mac if you want.

Comments (AU Comments · US Comments)
Scott
Posted December 14, 2007 12:29 PM
Another solution is to virtualise the app. This runs the software in what is really a windows 'sandbox', and you can kill or delete the program easily. The program does not have interference issues with any other software. Great for testing without having to worry about any registry damage or mess when uninstalling!
I've been playing with the free version of Altiris SVS and am so far impressed.
Rant93
Posted 4:13 PM 13/12/07
I ran into a case on Linux where I could not use killall because I wanted to kill a process by path name, not executable name.
ps -ef | grep '/path/to/file' | grep -v grep | awk '{print $2}' | xargs kill
Rant93
TheTrainedMonkey
Posted 3:29 PM 13/12/07
In *nix you can can do a "ps ax" to get a process list or a "ps ax | grep program" to get the process ID of a specific program
Once you have that ID then you can type
kill -9 processID (usually a 4 digit number)
Andrew
TheTrainedMonkey
tigerhawkvok
Posted 10:45 PM 13/12/07
I am not 100% sure of the cases, but I think that the taskkill command only works on certain brands of Windows (I believe XP Pro and Vista [all?]). At any rate, I've had problems using the command on some XP Home machines that don't recognize it.
tigerhawkvok
delphine
Posted 12:06 AM 14/12/07
Launchy fans can use the Killy plugin. I've been using it regularly instead of the Task Manager and it works really snappily. Heartily recommended.
delphine
fakeollie
Posted 2:39 AM 14/12/07
If you're in linux and don't want to find processIDs or open the command line, the quickest kill would be to run xkill (ALT+F2, xkill, enter). Your mouse pointer will turn into either a skull or a large X, click any open window (of the app you want to kill) and you got an instant kill, presto.
Oh, and a right-click will get you out of xkill without killing anything.
fakeollie
Protector one
Posted 5:26 AM 14/12/07
XP Home users can download a small app called pskill which has the same functionality as taskkill. I use it, it works. :)
Protector one
jayemef
Posted 7:38 AM 14/12/07
The problem with killall is that you need to know the exact process name. In the case of firefox, at least in Ubuntu, it's firefox-bin. So if you just did "killall firefox," it wouldn't work.
jayemef
Saibot
Posted 7:25 AM 14/12/07
On a somewhat related note, I had a chat client at work (IBM NotesBuddy) that used to crash several times a day. But I needed to be available continually for colleagues in other facilities to be able to reach me for quick questions.
I created a macro in MacroExpress (I've been using it for years, even tho there are several good freeware macro apps available now) to watch for the Dr. Watson error and then click OK on it and restart NotesBuddy in the background.
Thankfully, the new Sametime 7.5 client has all the functionality of NotesBuddy, and is stable! But this little macro was priceless for a few months.
Saibot
R031E5
Posted 7:19 AM 14/12/07
You can use the killall function on a mac:
Killall firefox
R031E5
Saibot
Posted 7:18 AM 14/12/07
XP's PROCESS command also has a -k switch which allows you to kill a process by name.
eg. process -k notepad.exe
Also of note, if your process is not actually hung (ie: not responding) but is chewing up CPU cycles, and you want to let it finish eventually but need to interrupt it temporarily, you can use the -s and -r switches to suspend and resume a process.
Saibot
jayemef
Posted 6:51 AM 14/12/07
Another useful command for *nix users is pgrep, which will return the pid of a process by part of it's name. So rather than grepping and filtering the results of ps, you can simply "pgrep program".
E.g., "pgrep firefox | xargs kill"
jayemef
lilpunk1302
Posted 4:51 PM 13/12/07
Anybody know how to get something liek this working for more than one app at a time?
My computer's slightly underpowered for GH3(I have a AMD 2400+ 2.1GHZ, 1 GIG ram, and 256 shared video memory)so when I play, I always have to go into the task manager and quit a whole bunch of apps(uTorrent, MSN, Konfabulator, etc)
So it'd be really nice to have a single shortcut quit them all, the actual apps don't change much so I'm willing to spend ~10 minutes to create the file then save like 2-3 per launch(3 times a day)
Bonus marks,
Creating a shortcut to relaunch all of the apps, thanks in advance.
lilpunk1302
Enigmaster
Posted 12:58 PM 14/12/07
I use the ever popular AutoHotKey to kill apps that need a good hard kick up the backside every now and then, with a restart built in.
For example, Win-a opens Firefox, while Win-shift-a kills and restarts:
#a::Run firefox
#+a::
Process, close, firefox.exe
Run firefox.exe
Return
Quite simple really. I've also experimented with a version that does the same for the active window, whatever that may be, but that's slightly more temperamental; sometimes it kills explorer, and sometimes it can't find whatever.exe to run.
Enigmaster
dicktater
Posted 3:36 PM 16/12/07
Linux?
Yakuake running htop!
Install yakuake for a cool (highly configurable as to size and location) drop down terminal window (multiple tabs, too) on an F-12 keypress (add and/or change to another hotkey, if desired in config menu). Yakuake is a really handy terminal window that can be loaded at startup for superquick access.
Install htop.
Run htop in yakuake. Sort order is CPU usage % by default.
Runaway process?
Hit yakuake hotkey (F-12) to lower yakuake window.
Runaway process should be highlighted at top consuming most CPU, or arrow down to highlight other process to kill.
Hit F-9 to kill highlighted process, enter to confirm.
Hit F-12 again to raise yakuake window.
Restart app.
I use this to manage the Opera/Flash issue that seems to happen when many tabs are open and I forget to enabke Flashblocker for Opera. Opera is set to resume where last closed. I'm back where I was in just a couple of minutes.
dicktater
Recky
Posted 4:34 AM 17/12/07
This is scary.. Yesterday I created a 'kill firefox' shortcut using pskill from sysinternals and now I read this.. Hmm maybe I'm not the only one who's firefox is performing worse and worse with every update ;)
Recky