taskkill | new in WS2003 |
taskkill [/s Computer] [/u Domain\UserName [/p Password]] [/fi FilterName] {[/pid ProcessID] | [/im ImageName]} [/f] [/t]
/s Computer
Name or IP address of a remote computer (if omitted, defaults to local computer).
/u [Domain\UserName [/p [Password]]]
Credentials for running the command (if omitted, defaults to currently logged-on user).
/fi FilterName
Filters the types of process(es) to kill using:
Status {eq | ne} {RUNNING | NOT RESPONDING | UNKNOWN}
Imagename {eq | ne}
Any valid string
PID {eg | ne | gt | lt | ge | le}
Any valid positive integer
Session {eg | ne | gt | lt | ge | le}
Any valid session number
CPUTime {eg | ne | gt | lt | ge | le}
Valid time in format HH:MM:SS
Memusage {eg | ne | gt | lt | ge | le}
Any valid integer
Username {eq | ne}
Any valid username in format Domain\UserName
Services {eq | ne}
Any valid string
Windowtitle {eq | ne}
Any valid string
Modules {eq | ne}
Any valid string
Be sure to put the filter in quotes.
/pid ProcessID
Process ID of process to kill
/im ImageName
Image name of process to kill (can use * to kill all processes)
/f
Forces termination of process
/t
Terminates the specified process and any child processes spawned by that process
Kill the instance of Notepad running on the local machine:
taskkill /fi "Imagename eq Notepad.exe" SUCCESS: Sent termination signal to the process with PID 308.
Use tasklist to obtain the process ID of running processes you wish to kill.
tasklist,
Tasks