|

How To Use The Tasklist And Taskkill Command In Windows (2026)

Tasklist shows every process running on your PC, and taskkill ends the ones you pick.

Together they let you find a stuck program in Command Prompt and close it by name or by process ID.

This guide uses Microsoft’s command references, so every switch and filter below is documented.

Table of Contents

Tasklist and taskkill quick answers

I want toType this
List every running processtasklist
Show only programs that are not respondingtasklist /fi "STATUS eq NOT RESPONDING"
End a process by IDtaskkill /pid 1230
End a process by name, forcefullytaskkill /f /im notepad.exe
End a process and its child processestaskkill /pid 2134 /t

What the two commands do

Microsoft says tasklist displays a list of currently running processes on the local computer or on a remote computer.

It replaces the older tlist tool.

Taskkill ends one or more tasks or processes, either by process ID (PID) or by image name, and replaces the older kill tool.

Microsoft’s taskkill page points you to tasklist for finding a PID, so the two are meant to be used together.

Open Command Prompt

  1. Press the Windows key and type cmd.
  2. Select Command Prompt.
  3. Type a command and press Enter.

If you need elevated rights, see how to open Terminal as administrator in Windows 11.

List running processes with tasklist

  1. Type tasklist and press Enter to see the table of running processes.
  2. Note the image name and the PID of the program you want to close.
  3. Add /v for verbose task information.
  4. Add /svc to list the services inside each process.

Microsoft notes that using /v and /svc together gives complete verbose output without truncation.

Change the tasklist output format

SwitchWhat it does
/fo tableTable output, which is the default.
/fo listList output.
/fo csvComma-separated output.
/nhHides column headers; valid with table or csv.
/svcService information for each process; valid with table format.
/m <module>Lists tasks with DLL modules that match the pattern.

An example from Microsoft combines them: tasklist /v /fi "PID gt 1000" /fo csv.

Filter the list with /fi

The /fi switch limits the output to matching processes.

You can repeat it, and Microsoft’s example shows that multiple filters are combined, so both conditions must match.

Filter nameOperatorsValid values
STATUSeq, neRUNNING, NOT RESPONDING or UNKNOWN
IMAGENAMEeq, neThe image name, such as notepad.exe
PIDeq, ne, gt, lt, ge, leA process ID number
SESSIONeq, ne, gt, lt, ge, leA session number
CPUTIMEeq, ne, gt, lt, ge, leHH:MM:SS
MEMUSAGEeq, ne, gt, lt, ge, leMemory use in KB
USERNAMEeq, neuser or domain\user
SERVICESeq, neA service name
WINDOWTITLEeq, neA window title
MODULESeq, neA DLL name

Use * as the wildcard, as in tasklist /fi "MODULES eq ntdll*".

Find a frozen program

  1. Run tasklist /fi "STATUS eq NOT RESPONDING".
  2. Read the image name and PID in the result.
  3. Run taskkill /pid <PID> with that number, or taskkill /im <name> with the name.

Microsoft notes the STATUS filter does not work against remote systems.

If you prefer a window, there is also how to force stop a program in Windows 11.

End processes with taskkill

SwitchWhat it does
/pid <processID>Ends the process with that ID.
/im <imagename>Ends processes with that image name; * means all image names.
/fForcefully ends the process.
/tEnds the process and any child processes it started.
/fi <filter>Selects tasks with a filter, using the same names as tasklist.

You can name several PIDs in one command, as in taskkill /pid 1230 /pid 1241 /pid 1253.

When you need /f and /t

The /f switch is optional, and Microsoft describes it as forcefully ending processes.

Adding /f forcefully ends it, so unsaved work in that program is lost.

Add /t when a program starts helper processes, because it ends the child processes too.

Microsoft’s example taskkill /pid 2134 /t /fi "username eq administrator" ends a PID and its children, but only if the Administrator account started them.

More examples from Microsoft

GoalCommand
End Notepad if the system started ittaskkill /f /fi "USERNAME eq NT AUTHORITY\SYSTEM" /im notepad.exe
End every process with a PID of 1000 or highertaskkill /f /fi "PID ge 1000" /im *
List processes with PID above 1000 as CSVtasklist /v /fi "PID gt 1000" /fo csv

The second example ends a large number of processes, so do not run it on a PC with unsaved work.

Find which process loads a DLL

The /m switch lists all tasks that have a DLL module matching the pattern you give.

If you leave the module name out, tasklist shows every module loaded by each task.

Microsoft’s example, tasklist /s srvmain /svc /fi "MODULES eq ntdll*", shows service information for processes on a remote computer whose DLL name begins with ntdll.

Which command for which job

JobCommand to useWhy
See what is runningtasklistLists processes on the local or a remote computer.
Find a PIDtasklist /fi “IMAGENAME eq notepad.exe”Filters the list by image name.
Close one programtaskkill /im notepad.exeEnds processes by image name.
Close a program and its helperstaskkill /pid 2134 /tThe /t switch ends child processes too.
Check another PCtasklist /s srvmainUses your current logged-on credentials when /u is not given.

Microsoft’s remote example for taskkill ends every process on Srvmain whose image name begins with note, using explicit credentials and the filter "IMAGENAME eq note*".

Use the commands on another computer

Both commands accept /s <computer> with a computer name or IP address, without backslashes.

The /u switch runs the command under another account and works only if /s is also given.

Microsoft notes that ending a remote process is always forceful, whether or not you add /f.

Microsoft’s examples put a password on the command line, which is a bad idea on shared or logged systems.

Wildcard and filter notes

Microsoft says the wildcard * is accepted for /im only when a filter is applied.

The WINDOWTITLE and STATUS filters are not supported when you name a remote system.

The taskkill page also mentions a hostname filter that does not appear in its own filter table, so stick to the filters listed in the table above.

Run tasklist again after taskkill to confirm that the process no longer appears in the list.

Check a PID twice before you end it, since closing the wrong process can close something you need.

Official sources

Both commands are documented on Microsoft Learn: tasklist and taskkill.

For a related view of what each program connects to, read how to see active network connections with Netstat.

Leave a Reply

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