1. Introduction
Use this tool to terminate a task by Process ID (PID) or image name.
2. Grammar
TASKKILL [/S system [/u username [/p [password]]]
{[/FI filter] [/pid ProcessID |/im imagename]} [/T] [/F]
2.1 Parameter list:
/S system Specifies the remote system to connect to.
/u [domain\]user Specifies the user context in which the command should be executed.
/p [Password] specifies the password for the provided user context. If omitted, prompt for input.
/FI Filter applies filters to select a group of tasks. Allow use of "*". For example, image name EQ acme*
/pid ProcessID Specifies the PID of the process to be terminated. Use TaskList to obtain PID.
/im imagename Specifies the image name of the process to be terminated. The wildcard ' * ' can be used to specify all task or image names.
/T terminates the specified process and the child processes that are enabled by it.
/f Specifies that the process is forced to terminate.
/? Displays the help message.
2.2 Filters:
Filter name valid operator valid value
----------- --------------- -------------------------
STATUS eq, ne RUNNING | Not Responding | UNKNOWN
IMAGENAME eq, NE image name
PID eq, NE, GT, lt, GE, le PID value
Session eq, NE, GT, lt, GE, le session number.
CPUTime eq, NE, GT, lt, GE, le CPU time, formatted as HH:MM:SS. HH-When, MM-min, ss-Sec
Memusage eq, NE, GT, lt, ge, le memory usage, in kilobytes
USERNAME eq, NE user name, in the format [domain\]user
MODULES eq, NE DLL name
Services EQ, NE service name
WindowTitle eq, NE window title
Description
----
1) The/IM switch will use the wildcard ' * ' only if the filter is applied.
2) The remote process is always forced (/f) to terminate.
3) "WindowTitle" and "STATUS" filters are not supported when specifying a remote machine.
3, for example
Taskkill/im notepad.exe
Taskkill/pid 1230/pid 1241/pid 1253/t
taskkill/f/im cmd.exe/t
taskkill/f/fi "PID ge/fi" windowtitle ne untitle* "
taskkill/f/fi "USERNAME eq NT authority\system"/im notepad.exe
taskkill/s system/u domain\username/fi "username ne nt*"/im *
taskkill/s system/u username/p password/fi "IMAGENAME eq note*"
Introduction to the Windows Taskkill command