If you want to list down all the background running tasks and terminate them using Command Prompt, you can use the Tasklist and Taskkill commands. This article will help you find all the details regarding those two commands so that you can force close any process in Windows 11/10.
Note: You can also use the PowerShell to execute the command. It will work when both – the Command Prompt and PowerShell are run with admin privileges.
Tasklist and Taskkill commands in Windows 11/10
If you are wondering why this program requires so much effort, then know that it was built not for a single computer but to manage multiple computers. Each program offers the option to connect to remote computers and even enter the password. The program is for Windows Servers, but it is also available on some Windows consumer versions.
Tasklist
The Tasklist is a utility that lists out the currently running processes either on a local computer or on a remote machine. You can quickly check which processes are running in the background, and then to terminate such processes; we can use the Taskkill command to kill it.
Syntax:
tasklist [/s <computer> [/u [<domain>\]<username> [/p ]]] [{/m <module> | /svc | /v}] [/fo {table | list | csv}] [/nh] [/fi <filter> [/fi <filter> [ ... ]]]</filter></filter></module></username> </domain></computer></m:rmargin>
If you run the command “tasklist /fo table,” it will list down all the programs in a clean format. You can check details such as memory usage to determine which process consumes more resources.
Find complete details of the syntaxes on Microsoft Docs.
Read: How to kill a Process using Command Line?
Taskkill
The name says it all; once you have identified which process you need to kill, you can use Taskkill to remove the program from the list of running processes.
Syntax:
taskkill [/s <computer> [/u [<Domain>\]<UserName> [/p [<Password>]]]] {[/fi <Filter>] [...] [/pid <ProcessID> | /im <ImageName>]} [/f] [/t]
The simplest way to terminate a program from the command line is to find the PID or Process ID of the program to Taskkill. The PID is listed when you execute the Tasklist to find details of the program usage. Here are some examples:
taskkill /pid 1230 /pid 1241 /pid 1253 taskkill /f /fi USERNAME eq NT AUTHORITY\SYSTEM /im notepad.exe
Find complete details of the syntaxes on Microsoft Docs.
I hope the post will help you get started with Tasklist and Taskkill.
Read: Task Host Window, Task Host is stopping background tasks
What is the command for taskkill and tasklist?
To find the background processes, you can use the tasklist command. For that, you need to enter this command: tasklist /fo table. On the other hand, if you want to terminate a task using the taskkill command, you need to enter this command:
tasklist [/s <computer> [/u [<domain>\]<username> [/p]]] [{/m <module> | /svc | /v}] [/fo {table | list | csv}] [/nh] [/fi <filter> [/fi <filter> [ ... ]]]</filter></filter></module></username> </domain></computer></m:rmargin
How to use taskkill in Windows 11?
To use the taskkill command in Windows 11, you need to find the task name first using the tasklist command. Then, you can prepare the command like this: taskkill /IM [program-name]
. Let’s say you want to terminate Notepad. For that, enter this command: taskkill /IM notepad.exe
.