Killing a process from Windows command line

Killing a process from command line may not be that common in Windows as in other operating systems, but it is equally useful and you will use it as often once you learn how to do it.
We can kill a process by process ID number or by process name.

Killing a process using its PID

Let’s open an elevated command prompt and search the PID we want to kill. An easy way to do this is unig “tasklist“.

tasklist /svc

Once you have the PID, use “taskkill” to eliminate the process. For instance, if you want to kill 1730 PID:

taskkill /f /pid 1730

Killing a process or processes by its name.

Here we can use “tasklist” as well to explore the processes running in the system.
Sometimes it will be more useful to use the name of the process instead the PID. This way you can kill a lot of processes at the same time.
We will be using “taskkill” as well.
In the next example, we kill all “chrome.exe” processes:

TASKKILL /F /IM chrome.exe

If the process you need to kill is a service, you can check our post about how to kill a process of a service.

Leave a Reply

Your email address will not be published. Required fields are marked *