Sometimes we get into a situation where the Windows Task Manager is not accessible for some reason, or the administrator has disabled it. At that time, it is not possible to get the details about the processes running and have to take the help of third-party tools to kill the application or process, which is running in the background and creating a problem in the computer system. If you are comfortable with the command line, then you can use the built-in Windows command-line tools called Tasklist and Taskkill. In this post, we will share details about it.
Note: You can also use the PowerShell to execute the command. It will work when both – the Command Prompt or PowerShell is run with admin privileges.
Tasklist and Taskkill commands in Windows 10
If you are wondering why to take so much effort, then know that this program was built not for a single computer, but to manage multiple computers. Each of the programs 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 figure out which process is consuming 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.