Command referencetaskkill
taskkill command (Windows / CMD)
What it does
End processes by process ID or executable image name. Searches for the taskkill command cmd usually need CMD syntax, practical switches, and notes on how it compares with PowerShell or Linux alternatives. This page covers syntax, common options, and copyable examples for Command Prompt.
End processes by process ID or executable image name.
Syntax
taskkill [/S system] [/PID processid | /IM imagename] [/T] [/F]
Common options
| Flag / option | Meaning |
|---|---|
| /PID id | Target a process by ID. |
| /IM name | Target processes by image name. |
| /T | Also end child processes. |
| /F | Force termination. |
| /FI filter | Select tasks using a filter. |
Practical examples
End by PID
taskkill /PID 4242
Requests termination of one process.
End image
taskkill /IM notepad.exe
Ends Notepad instances.
Force process tree
taskkill /PID 4242 /T /F
Forcibly terminates the process and children.
Linux ↔ Windows equivalent
Closest match: kill (Linux / bash / sh / zsh). Send a signal to one or more processes.
Common mistakes
- Using `/F` before allowing an application to save or clean up.
- Killing every process with a shared image name unintentionally.
Related commands
- tasklistList local or remote running processes with selectable fields and filters.
- Stop-ProcessStop one or more local processes by name, ID, or pipeline input.
- killSend a signal to one or more processes.
- Get-ProcessRetrieve local or remote process objects and resource metrics.
- psDisplay a snapshot of running processes.
- topMonitor processes and system resource use in real time.
FAQ
What does taskkill do in Command Prompt?
End processes by process ID or executable image name.
How do I run taskkill in CMD?
Open Command Prompt and follow `taskkill [/S system] [/PID processid | /IM imagename] [/T] [/F]`; quote paths containing spaces.
What is a practical taskkill example in CMD?
Try `taskkill /PID 4242` — Requests termination of one process.
Can taskkill be used in a batch file?
Yes. Check its exit code and escape CMD metacharacters when input is variable.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.