I know you are familiar with the traditional way to kill or end a process in Windows using Task Manager. This method is effective but killing processes in Command Prompt provides much more control and the ability to end multiple processes at once. All of this is possible with the TaskKill command. First, let's cover the basics. You can kill a process by the process ID (PID) or by image name (EXE filename).
Open up an Administrative level Command Prompt and run tasklist to see all of the running processes:
If you have multiple instances of an image open such as multiple firefox.exe processes, running the taskkill /IM firefox.exe command will kill all instances. When you specify the PID only the specific instane of firefox will be terminated. The real power of taskkill are the filtering options that allow you to use the following variables and operators.
- eq (equals)
- ne (not equal)
- gt (greater than)
- lt (less than)
- ge (greater than or equal)
- le (less than or equal)
- "*" is the wildcard.
C:\>taskkill /FI "WINDOWTITLE eq Internet*" /F
How about killing all processes running under the Shawn account:
To learn more about taskkill run it with the /? command just like any other Windows command.