To see all running processes on Windows via the command line, use the tasklist command. This utility provides a comprehensive list of all active applications and background services, their Process ID (PID), session name, and memory usage, allowing you to identify resource-heavy programs or frozen applications without using a graphical interface.
What You'll Need
- A computer running a version of Microsoft Windows.
- Access to the Command Prompt (cmd.exe) or Windows PowerShell.
- Administrator privileges (required for viewing certain system-level processes or terminating protected tasks).
Step-by-Step
- Open the Command Line Interface: Press the Windows key on your keyboard, type
cmdorPowerShellinto the search bar, and press Enter. To ensure you have the necessary permissions to see all system processes, right-click the application in the search results and select "Run as administrator". - Run the Basic Tasklist Command: In the window that appears, type
tasklistand press Enter. The system will generate a table displaying the Image Name (the executable file), the PID (Process Identifier), the Session Name, the Session number, and the Mem Usage (the amount of RAM the process is currently consuming). - Filter for a Specific Process: If the list is too long to navigate, you can search for a specific application using a filter. Type
tasklist /fi "imagename eq chrome.exe"(replacing "chrome.exe" with the name of the program you are looking for) and press Enter. The/fiswitch applies a filter, andeqstands for "equals". - View Services Linked to Processes: To see which Windows services are hosted within a specific process (useful for troubleshooting system services), type
tasklist /svcand press Enter. This adds a column to the output that lists the specific service names associated with eachsvchost.exeinstance. - Export the Process List to a File: If you need to save the list for later analysis or share it with a technician, you can redirect the output to a text file. Type
tasklist > processes.txtand press Enter. This creates a file named "processes.txt" in your current working directory containing the entire list. - Identify the Process ID (PID): Locate the process you wish to manage in the list and note the number in the PID column. This unique number is essential if you intend to stop the process using the command line, as multiple instances of the same program (like multiple browser tabs) may share the same image name but will always have unique PIDs.
- Terminate a Process via Command Line: Once you have the PID or the image name, use the
taskkillcommand to stop it. To stop a process by its name, typetaskkill /IM chrome.exe /F. To stop it by its PID, typetaskkill /PID 1234 /F(replacing 1234 with the actual PID). The/Fswitch forces the process to terminate, which is necessary for unresponsive applications.
Common Mistakes
One of the most frequent errors is forgetting to run the Command Prompt as an administrator. If you run tasklist as a standard user, you can see most processes, but you will be denied access when attempting to use taskkill on system-level processes or services owned by the "SYSTEM" account. You will receive an "Access Denied" error message if this occurs.
Another common mistake is typing the process name without the .exe extension when using the /IM (Image Name) switch. For example, typing taskkill /IM chrome /F will often fail because the system is looking for the exact filename, which is chrome.exe. Always include the file extension to ensure the command targets the correct executable.
Users also frequently confuse the tasklist command with taskkill. While tasklist is for observation and auditing, taskkill is for action. Attempting to use tasklist /F will result in an error because the force flag does not exist for the listing utility; it only applies to the termination utility.
Finally, be cautious when using the /F (force) flag with taskkill. Forcing a process to close prevents the application from performing its standard shutdown routine. This means any unsaved data in that application will be lost immediately, as the program is not given the chance to prompt you to save your work.
Tips
To make the tasklist output easier to read, you can change the format of the display. By using tasklist /v, you enable "verbose" mode. This provides additional details, such as the user account running the process and the window title of the application, which helps distinguish between different windows of the same program.
If you are dealing with a massive amount of data, use the more command to paginate the results. Type tasklist | more and press Enter. This allows you to view the list one screen at a time, pressing the Space bar to scroll down, rather than having the list fly past your screen instantly.
For those who prefer a table format that is easier to import into Excel, use the CSV format switch. Type tasklist /fo csv. This outputs the data as comma-separated values, which can be easily redirected to a file using tasklist /fo csv > list.csv, making it possible to sort and filter the data using spreadsheet software.
When troubleshooting a slow computer, look specifically at the "Mem Usage" column. If you see a process consuming an unusual amount of memory (e.g., several gigabytes for a simple text editor), it may be experiencing a "memory leak," indicating that the software is buggy and needs to be restarted or updated.
Troubleshooting
If you receive an "Access Denied" error when trying to kill a process, the first step is to check if your Command Prompt window says "Administrator: Command Prompt" in the title bar. If it does not, close the window, right-click the Command Prompt icon, and select "Run as administrator".
If a process refuses to close even with the /F (force) flag, it may be a critical system process protected by the Windows kernel. Attempting to kill these can lead to a Blue Screen of Death (BSOD) or an immediate system restart. If a non-system process is stuck, try booting the computer into Safe Mode, where fewer third-party drivers and services are loaded, and attempt the taskkill command again.
If the tasklist command returns an error stating that the command is not recognized, your system's PATH environment variable may be corrupted. You can bypass this by navigating directly to the folder where the utility lives. Type cd C:\Windows\System32 and press Enter, then try running tasklist again.
In cases where the command line is completely unresponsive due to a system freeze, the command line tools will not work. In this scenario, you must use the physical hardware reset button or the Ctrl+Alt+Delete menu to access the graphical Task Manager, as the command line relies on the same underlying system resources that may be locked up.
Frequently Asked Questions
Can I use tasklist to see hidden malware?
While tasklist shows all active processes, some advanced malware can hide itself from standard API calls. However, comparing the tasklist output with known legitimate Windows process names is a good first step in identifying suspicious activity.
What is the difference between tasklist and Task Manager?
Task Manager is a graphical user interface (GUI) that provides real-time updating graphs and a mouse-driven interface. tasklist is a command-line utility that provides a snapshot of processes at a specific moment, which is better for scripting and remote management.
Does tasklist work in PowerShell?
Yes, tasklist works in PowerShell because PowerShell can execute standard CMD executables. However, PowerShell has its own native command called Get-Process, which provides similar information in a more flexible object-oriented format.
Can I schedule tasklist to run automatically?
Yes, you can create a batch file (.bat) containing the tasklist > log.txt command and use the Windows Task Scheduler to run that batch file at specific intervals to monitor system performance over time.
Why are there so many svchost.exe processes?
The svchost.exe (Service Host) process is a generic host process for services that run from dynamic-link libraries (DLLs). Windows splits services into multiple svchost instances to prevent a single failing service from crashing every other service on the system.
Is it safe to kill any process I see in the list?
No. Killing critical system processes (like wininit.exe or csrss.exe) will cause Windows to crash immediately. Only terminate processes associated with applications you recognize or those that you have confirmed are unresponsive.