How to use the taskkill command in Windows 10/11

Type taskkill /im notepad.exe in Command Prompt to close Notepad, or add /f to force a frozen program shut; the same command accepts a process ID with /pid.

This guide covers taskkill syntax, finding process IDs, filters, force and tree kills, remote computers, one-click shortcuts, PowerShell's Stop-Process, and common errors on Windows 11 and Windows 10.

How to kill a process with taskkill

Taskkill is built into Windows 11 and Windows 10, so there is nothing to install. These steps close a program by its file name.

  1. Press Windows, type cmd, and select Command Prompt. Choose Run as administrator if the program runs under another account.
  2. Type tasklist and press Enter to see the image names of running programs.
  3. Type taskkill /im notepad.exe and press Enter, replacing notepad.exe with the image name you found.
  4. If the program ignores the request, run taskkill /f /im notepad.exe to force it closed.
  5. Run tasklist again and check that the image name is gone from the list.

Image names include the extension, so type chrome.exe rather than chrome. When a name matches several windows, taskkill ends every instance.

Why do you need to use the taskkill command?

Task Manager handles most frozen apps, but taskkill does things a mouse cannot. Microsoft describes it as the command that ends one or more tasks or processes by process ID or image name.

Situation Why taskkill helps
Task Manager will not open or responds slowly One typed line ends the process from Command Prompt
Several copies of one program are stuck /im ends every instance with that image name at once
You only want apps that stopped responding The STATUS filter targets NOT RESPONDING processes only
A program left child processes behind /t ends the process and every child process it started
The stuck program is on another PC /s, /u and /p end processes on a remote computer
You close the same app often A batch file and desktop shortcut turn the command into one click

If you prefer menus, the ways to force quit a program through Task Manager and keyboard shortcuts still apply.

The basic syntax of taskkill

The full syntax is taskkill [/s <computer> [/u [<domain>\]<username> [/p [<password>]]]] {[/fi <filter>] [...] [/pid <processID> | /im <imagename>]} [/f] [/t]. Square brackets mark optional parts, and the braces mean you must give a filter, a PID or an image name.

Parameter What it does
/pid <processID> Ends the process with that process ID; repeat /pid to end several
/im <imagename> Ends processes by image name, such as notepad.exe
/f Forces the process to end; ignored for remote processes, which are always forced
/t Ends the process and any child processes it started
/fi <filter> Selects processes by status, memory, user, window title and more
/s <computer> Targets a remote computer by name or IP address, without backslashes
/u <domain>\<username> Runs the command as another account; works only with /s
/p <password> Password for the account given in /u

Run taskkill /? in Command Prompt to print the same help offline.

How to find the PID of a process for taskkill

A process ID (PID) targets one exact instance, which is safer than an image name when several copies are open. Tasklist and Task Manager both show it.

  1. Open Command Prompt.
  2. Type tasklist and press Enter. The PID column lists each process ID.
  3. Narrow the list with a filter, for example tasklist /fi "IMAGENAME eq notepad.exe".
  4. Note the PID of the instance you want to close, then run taskkill /pid 1230, using your own number.
  5. End several at once by repeating the switch: taskkill /pid 1230 /pid 1241 /pid 1253.

Task Manager shows the same number on its Details tab. The tasklist command also exports results as CSV with /fo csv.

Find the PID for taskkill in the Windows 11 Task Manager Details tab
Each running process shows its process ID in the PID column of the Details tab, ready for taskkill /pid. (Image: Microsoft)

Using taskkill with filtering flags

The /fi switch picks processes by a property instead of a name. Each filter is written as name, operator and value inside quotes, and you can stack several /fi switches in one command.

Filter Operators Example
STATUS eq, ne taskkill /f /fi "STATUS eq NOT RESPONDING"
IMAGENAME eq, ne taskkill /fi "IMAGENAME eq note*" /im *
PID eq, ne, gt, lt, ge, le taskkill /f /fi "PID ge 1000" /im *
MEMUSAGE eq, ne, gt, lt, ge, le taskkill /fi "MEMUSAGE gt 500000" (value in KB)
USERNAME eq, ne taskkill /f /fi "USERNAME eq NT AUTHORITY\SYSTEM" /im notepad.exe
CPUtime eq, ne, gt, lt, ge, le taskkill /fi "CPUtime gt 01:00:00" (HH:MM:SS)
WINDOWTITLE eq, ne taskkill /fi "WINDOWTITLE eq Untitled – Notepad"
SESSION, SERVICES, MODULES eq, ne (SESSION also gt, lt, ge, le) Session number, service name or DLL name

The wildcard * works with /im only when a filter is also applied. Test a filter with tasklist /fi first, because tasklist shows the matches without ending anything.

Taskkill force close a program and its child processes

Browsers and launchers often start helper processes. Combining /f and /t ends the parent and every child it started, so nothing is left running in the background.

taskkill /f /t /im chrome.exe

/f forces each process to end, /t includes every child process started by it, and /im chrome.exe selects all processes with that image name. Swap in /pid 2134 to end one process tree by ID.

You should see: Running tasklist /fi "IMAGENAME eq chrome.exe" afterwards finds no matching tasks.

Taskkill on a remote computer

Taskkill can end processes on another Windows PC on your network. You need an account with rights on that computer, and the STATUS and WINDOWTITLE filters do not work remotely.

taskkill /s srvmain /u maindom\hiropln /p p@ssW23 /fi "IMAGENAME eq note*" /im *

/s names the remote computer, /u and /p supply the account and password, and the filter ends every process whose image name begins with note. Remote processes are always ended forcefully, so /f is not needed.

You should see: tasklist /s srvmain no longer lists the matching processes.

Leave out /p and its value if you do not want the password stored in your command history; /u still requires /s.

Creating taskkill applications with file shortcuts

Put a taskkill line in a batch file, then add a desktop shortcut to it. One double-click then closes the app without opening Command Prompt.

  1. Open Notepad and type the command you want, for example taskkill /f /im notepad.exe.
  2. Select File > Save as, set Save as type to All files, and name the file kill-notepad.bat.
  3. Open the folder where you saved it in File Explorer.
  4. Right-click kill-notepad.bat and select Create shortcut. In Windows 11, select Show more options first.
  5. Drag the new shortcut to your desktop and double-click it to run the command.

A batch file that ends processes owned by another account needs administrator rights, so right-click it and choose Run as administrator. The same trick works when you run commands as admin from the Run box.

Create a taskkill shortcut in Windows 11 via Show more options menu
Windows 11 hides Create shortcut in the classic menu, so select Show more options or press Shift+F10 first. (Image: Microsoft)

Clean-up system memory with the taskkill command

Ending a process releases the memory it was using. Filters let you target heavy or hung programs only, instead of guessing from Task Manager.

  1. Open Command Prompt as administrator.
  2. Run tasklist /fi "MEMUSAGE gt 500000" to list processes using more than about 500 MB. MEMUSAGE is measured in KB.
  3. Read the image names and keep anything you do not recognize; Windows system processes are not safe to end.
  4. End a hung app by name, for example taskkill /f /im photoshop.exe, or end every unresponsive app with taskkill /f /fi "STATUS eq NOT RESPONDING".
  5. Open Task Manager > Performance > Memory to see the memory that was freed.

Closing an app this way discards unsaved work. For a deeper look at memory graphs, the Task Manager performance guide explains each counter.

Check freed memory after taskkill in Task Manager Performance Memory view
Open Performance > Memory in Task Manager to see the memory that was freed, shown as In use and Available. (Image: Microsoft Q&A)

Taskkill vs Stop-Process in PowerShell

Your situation Use this Why
You work in Command Prompt or a batch file taskkill /im name.exe Built into cmd, with filters such as STATUS and MEMUSAGE
You work in PowerShell Stop-Process -Name notepad Takes a name without .exe and accepts piped Get-Process output
You need a prompt before each kill Stop-Process -Id 3952 -Confirm Shows the process name and ID before stopping it
The process is on another computer taskkill /s computer Stop-Process works only on the local computer
The process belongs to another user or SYSTEM Either, from an elevated window Both need Run as administrator for processes you do not own

Stop-Process asks for confirmation before stopping a process you do not own; -Force skips that prompt.

How to see if a process is still running after taskkill

  1. In the same Command Prompt window, run tasklist /fi "IMAGENAME eq notepad.exe" with your image name.
  2. Read the result: if no matching task is listed, the process ended.
  3. If the PID still appears, run taskkill /f /pid followed by that number.
  4. For a process tree, run tasklist /v /fi "STATUS eq running" and look for helper processes with the same name.
Check if a process is still running with tasklist in Command Prompt
Piping tasklist into find /c /i counts matching processes; any number above zero means instances are still running. (Image: Microsoft Q&A)

Taskkill not working

Taskkill says access is denied

The process belongs to another user, a service or SYSTEM, and your Command Prompt is not elevated.

  1. Close the current window.
  2. Press Windows, type cmd, right-click Command Prompt and select Run as administrator.
  3. Run the same taskkill command again, adding /f.

Taskkill says the process was not found

The image name is misspelled, missing .exe, or the process already ended.

  1. Run tasklist and copy the exact name from the Image Name column.
  2. Run taskkill again with the full name, including .exe, or use /pid with the number from tasklist.

The program will not close without /f

Without /f, taskkill asks the program to close, and a hung app cannot answer.

  1. Add /f to the command.
  2. Add /t as well if the app keeps child processes running.

Taskkill /im * is rejected

The wildcard is accepted for /im only when a filter is applied.

  1. Add a filter, for example taskkill /f /fi "STATUS eq NOT RESPONDING" /im *.
  2. Preview the matches first with tasklist and the same /fi filter.

The STATUS or WINDOWTITLE filter fails on a remote PC

Neither filter is supported when /s names a remote system.

  1. Switch to IMAGENAME, PID, USERNAME or MEMUSAGE filters for remote commands.
  2. Or sign in to that computer and run the STATUS filter locally.
How to use the taskkill command in Windows 10/11
Access is denied means the process belongs to another account; rerun taskkill /f from an elevated Command Prompt. (Image: Microsoft Q&A)

Taskkill command FAQ

What does taskkill /f do?

The /f switch forces the process to end instead of asking it to close. Use it for frozen programs. It is ignored for remote processes, because taskkill always ends remote processes forcefully.

What is the difference between taskkill /im and /pid?

/im ends processes by image name, such as notepad.exe, and closes every instance with that name. /pid ends only the process with that exact process ID, which you can read from tasklist or the Details tab in Task Manager.

How do I kill all processes with the same name?

Run taskkill /f /im followed by the image name, for example taskkill /f /im chrome.exe. Every process with that image name ends, and adding /t also ends the child processes they started.

Does taskkill need administrator rights?

Not for programs you started yourself. Processes that belong to another user, a service or the SYSTEM account need a Command Prompt opened with Run as administrator, otherwise Windows denies access.

Can taskkill end a process on another computer?

Yes. Add /s with the computer name or IP address, and /u and /p for an account with rights on that PC. Remote processes are always ended forcefully, and the STATUS and WINDOWTITLE filters do not work remotely.

Is taskkill the same as Stop-Process?

Both end running processes. Taskkill is a Command Prompt tool that also works on remote computers, while Stop-Process is a PowerShell cmdlet that works only on the local computer and takes a name without the .exe extension.

Will taskkill delete the program?

No. Taskkill only ends the running process, and the program stays installed. Any unsaved work in that program is lost, and you can start the app again normally.

How do I close all programs that are not responding?

Open Command Prompt and run taskkill /f /fi "STATUS eq NOT RESPONDING". The filter selects only processes Windows reports as not responding, leaving working apps alone.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

Your email address will not be published. Required fields are marked *