tasklist

On this page 7

tasklist is a built-in Windows command-line utility that displays the processes currently running on a local or remote computer, together with each process’s image name, process ID (PID), session and memory usage. In the toolkit of PowerShell & command line administration, it is the text-based counterpart of the Processes tab in Task Manager and the standard partner of taskkill, which ends the processes that tasklist identifies.

The tool ships as tasklist.exe in the System32 folder of every supported Windows edition and has been available since Windows XP Professional. It runs equally well from Command Prompt, Windows Terminal, a batch file or a PowerShell session, which makes it a dependable choice for scripts that must work on any Windows machine.

How tasklist reports running processes

Run without parameters, tasklist queries the operating system for the process table and prints one line per process in a fixed-width table. The default columns are Image Name, PID, Session Name, Session# and Mem Usage, where the memory figure reflects the working set, the physical memory pages currently assigned to the process.

Additional switches add detail or change the output format. The verbose switch pulls in the owning user, CPU time and window title, while the service switch reveals which Windows services run inside each process, which is essential for untangling the many svchost.exe instances on a typical system.

SwitchPurposeTypical use
/vVerbose output with status, user name, CPU time and window titleFinding which account runs a process
/svcLists services hosted in each processMapping svchost.exe instances to services
/m [module]Lists DLLs loaded by each processFinding which processes use a given library
/appsShows Microsoft Store apps and their packagesInspecting modern app processes
/fi filterFilters the result set by criteriaNarrowing output to relevant processes
/fo table, list or csvSelects the output formatFeeding output into scripts or spreadsheets
/nhSuppresses column headersCleaner parsing of table or CSV output
/s, /u, /pTargets a remote computer and credentialsRemote inventory from an admin workstation
Main tasklist switches

Some switches cannot be combined: /svc, /m and /v are mutually exclusive, so a script that needs both service mapping and user names must run tasklist twice.

Filtering tasklist output with /fi

The /fi parameter applies a filter expression of the form name, operator and value, enclosed in double quotes, for example tasklist /fi "imagename eq chrome.exe". Several /fi clauses can be chained, and a process must satisfy all of them to appear, which works as a logical AND.

Filter nameValid operatorsExample value
IMAGENAMEeq, nenotepad.exe or wildcard such as note*
PIDeq, ne, gt, lt, ge, le4120
STATUSeq, neRUNNING, SUSPENDED, NOT RESPONDING, UNKNOWN
USERNAMEeq, neCONTOSO\jsmith
MEMUSAGEeq, ne, gt, lt, ge, le500000 (value in KB)
SERVICESeq, neSpooler
WINDOWTITLEeq, neUntitled*
MODULESeq, nentdll.dll
Common filter names and operators

A frequent use is finding hung applications with tasklist /fi "status eq not responding". Note that STATUS and WINDOWTITLE filters are not supported for remote queries, because that information depends on the interactive desktop session of the target machine.

tasklist compared with other process tools

Windows offers several ways to inspect processes, and the right one depends on whether the output is meant for human reading, text parsing or object pipelines. The comparison below shows where tasklist fits.

ToolOutput typeStrengthWeakness
tasklistText table, list or CSVAvailable everywhere, simple filters, remote queriesText must be parsed, limited columns
Get-ProcessPowerShell objectsRich properties, sorting and pipingRequires PowerShell, no service mapping by default
WMIC processText or formatted outputExposes command lines and parent PIDsDeprecated and being removed from Windows
Task ManagerGraphical interfaceReal-time view, easy for usersNot scriptable
taskkillAction, not listingEnds processes using the same filtersDoes not report process details
Process inspection tools in Windows

Because tasklist and taskkill share the same filter syntax, administrators often test a filter with tasklist first and then reuse it unchanged with taskkill, which prevents terminating the wrong process.

Using tasklist in scripts and remote administration

For automation, CSV output without headers is the most robust format. A batch file can check whether a program is running with tasklist /fi "imagename eq app.exe" /fo csv /nh and search the result with find, because tasklist returns exit code 0 even when nothing matches and prints an informational message instead.

Remote queries use the /s switch with an optional account in /u and password in /p. They rely on Remote Procedure Call and WMI connectivity, so the target must allow the relevant firewall rules and the account must hold local administrator rights on that computer. Supplying /p on the command line exposes the password in history and process listings, so omitting it and typing the password at the prompt is safer.

GoalCommand patternResult
Identify the process on a portnetstat -ano, then tasklist /fi “pid eq 4120”Image name behind a listening port
Map services to svchosttasklist /svc /fi “imagename eq svchost.exe”Service names per hosting process
Find large memory consumerstasklist /fi “memusage gt 1000000”Processes above about 1 GB working set
Export an inventorytasklist /v /fo csv > procs.csvSpreadsheet-ready process list
Practical tasklist commands

Limitations and common mistakes

The utility shows a snapshot, not a live view, so short-lived processes may appear or vanish between runs. It also does not show command-line arguments or parent process IDs, details that often matter in troubleshooting and security investigations; Get-CimInstance with the Win32_Process class provides them.

  • Output text is localized, so scripts that search for English column names or status words can fail on other language editions.
  • User names appear only with elevation for processes owned by other accounts; without administrator rights some entries show N/A.
  • Memory figures are working set only and do not reflect private bytes or committed memory, which can mislead leak investigations.
  • Quoting errors in /fi expressions are the most common cause of the message that the search filter cannot be recognized.

For anything beyond quick checks, many administrators move to PowerShell objects for reliable parsing while keeping tasklist for environments where PowerShell is restricted or unavailable.

Understanding it simply

Every program open on a Windows computer, including many you never see, is running as a process. tasklist prints a list of all of them in a text window, with a number that identifies each one and how much memory it uses.

Think of it as a register of everyone currently inside a building, printed on demand. You can ask for the whole register or only for certain names, and you can even ask for the register of another building on the network if you have the keys. The key takeaway is that tasklist only shows what is running; it never changes anything.

Applied in practice

A systems administrator at an accounting firm receives reports that a web-based internal tool on port 8080 cannot start because the port is already in use. On the affected server, she runs netstat -ano and sees that PID 6532 is listening on 8080.

She then runs tasklist /svc /fi "pid eq 6532" and learns that the process is a leftover instance of a reporting service that was supposed to have been retired. Before acting, she confirms the owner with a second command using /v, which shows a service account rather than a user.

She stops and disables the service, and the internal tool starts normally. She also adds the tasklist check to a short startup batch script that logs any process bound to port 8080, so the next conflict is diagnosed in seconds instead of an hour.