Is there any way of killing all instances of a specific program with a command-line command?
On Windows 7 (Vista?), I prefer
tskill processname as you don't need to remember command line switches or write .exe at the end. eg:
Will kill all chrome processes.
On windows XP I used
pskill from the pstools suite, which uses a similar syntax. Both these commands can also work on remote computers, if you have admin rights.
On many system you will find the commands
If you know the PID of the process then you can use
The first kills only one specific process. (Or rather, it sends a signal to it, e.g. the signal to terminate). You can write a wrapper around that with ps and grep to kill all processes matching a name.
or, if installed, you could use
Beware though, not all killall commands do the same thing. On Solaris it kills all processes. I repeat, all. Not just those you wanted but each and every process you have the rights to kill will get killed. Make sure you check the manual page of your local system and or check if it is a link to killall5.