Last updated:
When an app stops responding, closing it with the X button or Alt + F4 sometimes does nothing. Taskkill is the Command Prompt and PowerShell tool built into Windows for ending a process directly, by its process ID (PID) or by its executable name, without waiting for the app to notice.
Quick answer: open Command Prompt and run taskkill /IM appname.exe /F to end a process by name, or taskkill /PID 1234 /F to end it by process ID (find the PID first with tasklist). Only add /F when the app will not close normally — it skips the request to save work and ends the process immediately.
Taskkill syntax
The full syntax, as Microsoft documents it:
taskkill [/s <computer> [/u [<domain>\]<username> [/p [<password>]]]] {[/fi <filter>] [...] [/pid <processID> | /im <imagename>]} [/f] [/t]
| Parameter | What it does |
|---|---|
/s <computer> |
Name or IP address of a remote computer. Default: the local computer. |
/u <domain>\<username> |
Runs the command as the specified user. Only valid together with /s. |
/p <password> |
Password for the account given in /u. |
/fi <filter> |
Selects processes with a filter instead of a PID or name. Multiple /fi filters can be combined. |
/pid <processID> |
Process ID of the process to end. |
/im <imagename> |
Executable (.exe) name of the process to end. * matches every image name, but only when a filter is also applied. |
/f |
Forces the process to end immediately. Ignored on a remote computer, where every process is already ended forcefully. |
/t |
Also ends every child process started by the target process. |
If a stubborn app keeps coming back after you close it, force quitting applications on Windows through the GUI covers the same job without the command line.
How to use taskkill
End a process by its PID
Open Start, search for cmd, right-click Command Prompt, and choose Run as administrator. First find the PID with tasklist, which lists every running process with its PID in the second column:
tasklist

Then end it by PID. Without /F, Windows asks the process to close gracefully first, which can fail if the app is frozen:
taskkill /PID 15076
You can target several processes in one command: /PID 1111 /PID 2222 /PID 3333. The exact syntax below — built the same way, with a filter instead of a bare PID — is also the command used later in this guide for a desktop shortcut, pictured there in the Create Shortcut dialog.

End a process by its image name
Imagename is the .exe file name, also listed by tasklist. Ending a process by name is handy when the PID keeps changing between runs:
taskkill /IM mspaint.exe

Kill several by name the same way: /IM app1.exe /IM app2.exe.
Force a process to end immediately
Add /F when a process ignores the plain request above. It skips the close-gracefully step entirely, so any unsaved work in that app is lost:
taskkill /f /PID 14832

The same flag works with an image name instead of a PID:
taskkill /f /IM Taskmgr.exe

End a process and its child processes
Add /T to a normal PID or image-name command to also end every child process the target started. /T cannot be used on its own — it always needs /PID or /IM alongside it:
taskkill /PID 2134 /T
tasklist has no flag that shows a process’s parent PID, so use PowerShell’s Get-CimInstance instead:
Get-CimInstance Win32_Process -Filter "ProcessId = 2134" | Select-Object ProcessId, ParentProcessId, Name
Note: older guides point to wmic process get ProcessID, ParentProcessID for this. Microsoft disabled wmic.exe by default starting with Windows 11 23H2/24H2, and removed it outright from supported Windows 11 versions in the August and September 2026 preview updates — so on an up-to-date PC, the wmic command above will not run unless you reinstall it as an optional feature. Use Get-CimInstance instead; it replaces every common wmic use case and is not being removed.
End a process on another PC
Add /S, /U, and /P to target a remote computer:
taskkill /s <remote computer> /u <domain>\<username> /p <password> /fi "imagename eq note*" /im *
A remote process always ends forcefully — /F is implied and is ignored if you type it. If this returns “The RPC server is unavailable,” Windows Management Instrumentation is usually blocked by the remote computer’s firewall. On that remote PC, run this in an elevated PowerShell window, then try again:
Enable-NetFirewallRule -DisplayGroup "Windows Management Instrumentation (WMI)"
You will also need the target machine’s exact name, which the hostname command in Windows returns when run on that PC.
End a process with a filter
Filters select processes by a condition instead of a fixed PID or name, and several can be combined in one command.
| Filter | Operators | Values |
|---|---|---|
STATUS |
eq, ne | RUNNING, NOT RESPONDING, UNKNOWN |
IMAGENAME |
eq, ne | Image name |
PID |
eq, ne, gt, lt, ge, le | Process ID |
SESSION |
eq, ne, gt, lt, ge, le | Session number |
CPUTIME |
eq, ne, gt, lt, ge, le | HH:MM:SS (MM and SS from 0 to 59; HH any unsigned number) |
MEMUSAGE |
eq, ne, gt, lt, ge, le | Memory usage in KB |
USERNAME |
eq, ne | Username or domain\username |
SERVICES |
eq, ne | Service name |
WINDOWTITLE |
eq, ne | Window title |
MODULES |
eq, ne | DLL name |
Note: the WINDOWTITLE and STATUS filters are not supported when /S targets a remote computer.
Close every “Not Responding” program at once
Combine /F with the STATUS filter to force-close whatever Windows currently marks as not responding, in one command:
Stuck at this step? Ask us, it is free and include the exact error.
taskkill.exe /f /fi "status eq not responding"

If nothing is actually frozen, this command simply reports that no tasks matched the filter — it will not touch a process that is running normally.
Turn it into a keyboard shortcut
Because the command above is safe to repeat, it is worth binding to a shortcut key.
Step 1: Right-click the desktop, choose New, then Shortcut.
Step 2: Paste the full path, including the quotation marks around the filter, and click Next:
C:\Windows\System32\taskkill.exe /f /fi "status eq not responding"

Name the shortcut and finish the wizard, then open its Properties. On the General tab, click Advanced, tick Run as administrator, and click OK — without this, the shortcut will fail silently because taskkill needs an elevated process to end most apps:

Then on the Shortcut tab, click inside Shortcut key and press a letter — Windows fills in the Ctrl + Alt + combination automatically:

Press that key combination any time to close every frozen program in one step.
PowerShell alternative: Stop-Process
Taskkill.exe also runs fine from inside PowerShell, but PowerShell has its own native cmdlet that behaves slightly differently. Stop-Process asks for confirmation before stopping a process you do not own, unless you add -Force:
Stop-Process -Name "notepad"
Stop-Process -Id 3952 -Force
To stop a process owned by another account — for example a system process — PowerShell must itself be running elevated, the same requirement taskkill has for most non-user processes.
Troubleshooting
| Message or symptom | Likely cause | Fix |
|---|---|---|
| ERROR: The process with PID <n> could not be terminated. Reason: Access is denied. | The process belongs to another user or is a protected system process, and Command Prompt is not elevated | Re-open Command Prompt with Run as administrator and try again |
| ERROR: The process “name.exe” not found. | Typo in the image name, or the process already closed | Run tasklist again to confirm the exact name and that it is still running |
| The RPC server is unavailable | Windows Management Instrumentation is blocked on the remote computer’s firewall | Run the Enable-NetFirewallRule command above on the remote PC |
| Shortcut key does nothing | Run as administrator was not checked on the shortcut, or the shortcut key field was left empty | Reopen the shortcut’s Properties and check both settings from the steps above |
| taskkill ends the app, but it reopens itself seconds later | A parent process, a scheduled task, or a Windows service is restarting it | Add /T to also end the parent’s child processes, or check Task Scheduler and Services for an entry that restarts it |
Using Task Manager instead
For a one-off, the GUI is usually faster. Press Ctrl + Shift + Esc, right-click the process, and choose End task — the same effect as taskkill /f:

Expand a process in the list to see and individually end its child processes — the same parent-child relationship that /T targets from the command line:

Before you use taskkill
Taskkill with /F closes an app immediately with no save prompt, so finish any unsaved work first if the app still responds at all. Avoid ending Windows system processes you do not recognize — some are required for Windows to keep running, and /F will still try to end them if you are elevated. If you are unsure which process is which, check Task Manager’s Details tab first and target it by PID.
FAQ
What does taskkill /f actually skip? It skips the normal close request a process can ignore or delay. Without /F, Windows asks the app to close itself (its own save-prompt logic still runs if the app handles that message); with /F, the process is ended immediately, with no chance to save.
Is taskkill the same as End Task in Task Manager? Functionally yes — End Task sends the same forceful termination as taskkill /f. Task Manager is just the GUI for the same underlying Windows API call.
Can taskkill end a process on another computer? Yes, with /S, /U, and /P, provided Windows Management Instrumentation is reachable through that computer’s firewall.
Does taskkill work the same in PowerShell? taskkill.exe itself behaves identically there. PowerShell also has its own Stop-Process cmdlet, covered above, which some scripts prefer because it accepts piped process objects.
Can I undo taskkill? No. The process ends immediately and any unsaved data in it is gone; only files it had already saved to disk are unaffected.