COMMAND

tasklistList running processes

tasklist lists the processes running on a Windows machine with their process ID (PID), session and memory use. Filter with /fi to find a specific PID or image name, and use /svc to see which services each process hosts, which is essential for understanding svchost.exe.

BlackhawkHub Editorial · Updated

Purpose

tasklist is Task Manager for the command line: it enumerates running processes and their basic properties, and it filters, which makes it the standard way to turn a PID from netstat into a program name.

Basic use

cmd
tasklist
text
Image Name          PID Session Name  Session#  Mem Usage
================= ===== ============ ========= ==========
svchost.exe        1234 Services            0    12,004 K
explorer.exe       5678 Console             1   142,880 K

Find a specific process

cmd
tasklist /fi "PID eq 8210"
tasklist /fi "IMAGENAME eq chrome.exe"
tasklist /fi "MEMUSAGE gt 500000"

The filters (/fi) accept PID, IMAGENAME, MEMUSAGE, STATUS, SESSION, USERNAME and more, with operators eq, ne, gt, lt.

See hosted services

cmd
tasklist /svc

This maps each process to the services it hosts, which is the only way to see what a given svchost.exe instance is actually running. Combine with a PID filter to inspect one instance.

Verbose and formatted output

cmd
tasklist /v
tasklist /fo csv /nh > processes.csv

/v adds the window title, CPU time and user; /fo csv suits export.

Remote query

cmd
tasklist /s SERVER01 /u DOMAIN\admin /p

Common mistakes

  • Quoting filters wrongly. The whole filter expression is one quoted string: /fi "PID eq 8210".
  • Expecting per-service memory from a shared svchost; the process total covers all its services.

PowerShell equivalent

Get-Process lists processes as objects; Get-Process -Id 8210 targets a PID; Get-CimInstance Win32_Service | Where-Object ProcessId -eq 1234 shows the services a PID hosts.

Frequently asked questions

How do I find the process using a specific PID?

tasklist /fi "PID eq 8210". Combined with netstat -ano (which gives the PID owning a port), this identifies which program holds a port.

How do I see which services run inside svchost.exe?

tasklist /svc lists each process with the services it hosts. For a specific svchost PID: tasklist /svc /fi "PID eq 1234". See the svchost.exe record.

Sources