Using Batch Commands to Kill Processes on Windows

On Windows you can use the taskkill command to terminate a process.

Common options:

/PID processid Specifies the PID of the process to terminate.

/IM imagename  Specifies the name of the process to terminate.

/T             Terminates the specified process and the child processes it started.

/F             Forces termination of the process.

/?             Displays the help message.

Example:

TASKKILL /IM notepad.exe
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
TASKKILL /F /IM cmd.exe /T

Author: Tang Moying

Source: /en/post/windows-task-kill

License: this article is shared under "CC BY 4.0". Please credit the author and link back to the original when republishing.