Manage processes and tasks from the command line in Windows It is a skill that can get you out of more than one tight spot, especially when an application gets stuck or you need advanced system information. Although many users prefer the graphical interface, learn to use commands like TASKLIST and TASKKILL opens up a whole world of possibilities for precisely control everything that happens on your computer, both locally and remotely.
In this article you will find a complete and detailed guide on how to leverage TASKLIST and TASKKILL to View, filter, analyze, and close running processes in Windows, either from the console CMD, scripts or batch files. In addition, we will explain Key differences between processes and services, advanced combinations, practical examples, and some little-known extra utilities. Get comfortable, we're getting started!
What are processes and services in Windows and how are they managed?
To understand how they work TASKLIST and TASKKILL, it is first convenient to distinguish two key concepts: proceedings y the serviceAlthough they are sometimes used as synonyms, they are not exactly the same.
- Processing: It's any program or application that's running. It can be in the foreground (you see it on the screen) or in the background (no window is visible). Each process has a unique identifier called PID. Processes can start and stop other processes or even services. A process can be completed ("kill the process"). They usually have a life cycle: from the moment they start until they finish executing.
- Service: It is a special type of process that normally works in the background, even if no one is logged on to the computer. Services can be started, stopped, paused, resumed or deleted, But It is not usual to "kill" them like a normal process. They are usually permanently active unless an error occurs or they are managed manually.
Both (processes and services) can queried, controlled, and terminated using command-line tools such as TASKLIST and TASKKILL, who are protagonists in the advanced Windows administration.
TASKLIST: List and filter processes in Windows from the terminal
Tasklist It is the command par excellence to obtain the list of programs, tasks and services running on the computer, either local or remote. It's like a "text" version of the Task Manager, but much more detailed and with the possibility of filter and export results.
The most basic syntax is as simple as running:
tasklist
This will display a listing that includes the image name (name of the executable), the PID’s most emblematic landmarks, the session name’s most emblematic landmarks, the session number and the memory usage in KB. Ideal for a quick check of what's running on your system.
Tasklist It can be launched from CMD, the Run box, the Start menu, or integrated into batch scripts. Some useful parameters to get the most out of it:
- /V – Display extended information (user, status, CPU time, window title, etc.)
- /SVC – Report on the services hosted by each process. Very useful for seeing which services are related to system processes.
- /M – Filters tasks that use a specific module (DLL or EXE). For example,
tasklist /M ntdll.dll
. - /FO format – Change the output format: “TABLE” (standard table), “LIST” (by lines) or “CSV” (ideal for Excel).
- / NH – If you use “TABLE” or “CSV”, hide the column headers.
- /FI filter – Apply advanced filters to any field (user, memory, PID, image name, status, etc.).
- /S system – Allows you to run the command against a remote computer (ideal for network administration).
- /U domain\user – Run the command with specific credentials (requires using /S to connect to remote computers).
- /P password – Password for the specified user.
By combining these options, you can extract virtually any process-related data. And if you need one quick chop For all parameters, you can create a help file:
TASKLIST /? > %userprofile%/Desktop/use-tasklist.txt
Filtering results with /FI: Practical usage examples
The real power of TASKLIST lies in its /FI option, which allows you to search, filter, and narrow down the information obtained based on multiple criteria. Here are some useful examples:
- List only the processes your user is running:
tasklist /FI "USERNAME eq your_user"
- View processes that are currently active:
tasklist /FI "STATUS eq running"
- Filter by image name (e.g. Firefox):
tasklist /FI "IMAGEAME eq firefox.exe"
- Find processes with allocated memory greater than 15000 KB:
tasklist /FI "MEMUSAGE gt 15000"
- Combine multiple filters to refine your search:
tasklist /FI "IMAGEAME eq notepad.exe" /FI "USERNAME eq user"
- Export the list in CSV format for further processing:
tasklist /V /FO CSV > %userprofile%/Desktop/process-list.csv
You can also redirect output to a file and conveniently open it in Excel or Notepad. Perfect for audits or reports!
Monitoring processes on remote computers
If you manage multiple computers on a network, TASKLIST allows you to query processes on remote machines as long as you have the credentials suitable and the firewall does not block it.
For example:
tasklist /s remote_pc_name /u domain\user /p password
This returns the list of processes on the remote machine. You can add filters, change the format, export results, and so on, just as if it were your own computer.
Advanced filtering and exporting examples
- Processes that use the DLL ntdll.dll on the remote computer srvmain (ideal for detecting malware or conflicts):
tasklist /s srvmain /svc /fi "MODULES eq ntdll*"
- Show only processes whose PID is greater than 1000, in CSV:
tasklist /v /fi "PID gt 1000" /fo csv
- View all processes except those started by the system:
tasklist /fi "USERNAME ne NT AUTHORITY\SYSTEM" /fi "STATUS eq running"
TASKKILL: How to forcefully terminate processes
TASKKILL is "perfect couple" from TASKLIST. It is used to terminate one or more processes using its PID (process identifier) or image name. Very useful when a program is stuck or you need to automate task shutdown.
The simplest way is:
taskkill /PID 1234
You can also kill processes by name:
taskkill /IM firefox.exe
Beyond this, TASKKILL has many options:
- /F - Force Immediate shutdown. Ideal when the process isn't responding!
- /T - Ends the process and all its child processes. Very useful if the program launches threads and you want to close everything at once.
- /FI filter – Apply filters like in TASKLIST. For example, you can only terminate processes with a certain user, status, or memory usage.
- /S – Allows you to run the command on remote machines.
- /U y /P – To indicate username and password in case of remote computers.
To view all parameters and create a help file:
TASKILL /? > %userprofile%/Desktop/uso-taskkill.txt
Advanced Filters in TASKKILL and Useful Examples
- Closing Notepad abruptly (even if it is frozen):
taskkill /F /IM notepad.exe
- Kill processes with PID greater than or equal to 1000, whatever they may be:
taskkill /f /fi "PID ge 1000" /im *
- Terminate all unresponsive processes except WhatsApp:
taskkill /F /FI "STATUS eq NOT RESPONDING" /FI "WINDOWTITLE ne WhatsApp"
- Force close scripts in VBScript:
taskkill /F /IM wscript.exe
- Close Windows Explorer and restart it with a 5-second delay:
taskkill /F /IM explorer.exe & timeout /nobreak 05 & start explorer.exe
- Kill processes started by the Administrator:
taskkill /pid 2134 /t /fi "username eq administrator"
- Kill processes on a remote machine with an image name starting with "note":
taskkill /s srvmain /u maindom\hiropln /pp@ssW23 /fi "IMAGEAME eq note*" /im *
As you see, the possibilities are enormous. You automate from memory cleanups to daily management of all active processes, both on your computer and on any other computer on the network.
Automation with batch files
One of the advantages of TASKKILL and TASKLIST is that You can easily include them in .bat or .cmd files for execute automatic actions during Boot from Windows or scheduled with Task Scheduler.
Typical example: close several annoying processes at Windows startup.
@echo off taskkill /F /IM process1.exe taskkill /F /IM process2.exe taskkill /F /IM process3.exe
Then you just have to place your batch file in the Windows startup folder (shell: Startup in the Run command) and that's it.
Frequently used parameters and supported filters
Both in TASKLIST and TASKKILL, filters can be applied to:
- STATUS: eq, ne – Values like RUNNING or NOT RESPONDING
- IMAGE: eq, ne – For example, chrome.exe
- PID: eq, ne, gt, lt, ge, le – To limit by process number
- SESSION / SESSIONNAME: eq, ne, gt, lt, ge, le – By session or session name
- CPUTIME: eq, ne, gt, lt, ge, le – Filter by CPU time (HH:MM:SS format)
- MEMUSAGE: eq, ne, gt, lt, ge, le – By memory consumption in KB
- USERNAME: eq, ne – By username (domain\user)
- SERVICES: eq, ne – By related service name
- WINDOWTITLE: eq, ne – For the window title
- MODULES: eq, ne – By DLL or module used
Some filters like WINDOWTITLE y STATUS are only supported for local computers, not remote ones. Also, the * wildcard in /IM only works if a filter is applied.
Services vs. processes: advanced management and monitoring
In addition to processes, in Windows you can manage and monitor services with tools such as the SC (Service Control) command. Services can be queried, started, stopped, paused, resumed, deleted, created… from the terminal.
For example, to list active services:
sc query type= service
To show all (active and inactive):
sc query state= all
And to remove a service completely:
sc delete ServiceName
If you have to deal with unruly services or want to create automations, combine SC y tasklist/taskkill It will help you a lot.
As you see, learning to use Tasklist y TASKKILL Advanced commands give you much more control over your system. Whether you're a curious user, a power user, a system administrator, or simply want more resources to solve problems arising from poor performance, blocked processes, or automated management, now you know that the command line is your ally. Remember to practice, and little by little, you'll see how these commands become part of your personal "toolbox." Whether you're at home, at work, or managing remote environments, with these commands you'll be able to handle any situation!
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.