How Terminate Processes with the Taskkill Command

The Taskkill command gives you more control as you end processes, and even works on tasks that refuse to close even after tried to terminate them in Task Manager.

Open the Command Prompt by clicking Start Menu --> All Programs --> Accessories, right-click on Command Prompt, and open it as an administrator. In Windows Vista and later versions of Window operating systems type cmd.exe into Start Screen or Start Menu, right-click on cmd.exe, and open it as an administrator.

At the Command Prompt type Tasklist command and press Enter key. The Tasklist command, will generate a list of running programs just like those you would find in the Windows Task Manager.

As you can see in the screenshot, a table lists all running programs by Image Name, PID, Session Name, Session# and Memory Usage.

How Terminate Processes with the Taskkill Command EWVhUTp

If there is a program you want to terminate, scroll through the list, then look for the PID. You can also use the Image name too. So, say I want to terminate Notepad, i can execute following command.

Code:

Taskkill  /IM  Notepad.exe  /F


The Taskkill parameters you see in the command: /IM and /F tell the command to reference the image name (/IM) and force (/F) the process to quit entirely regardless of any conflicts.

Above command terminates all open Notepad processes, ıf there is a single process or part of a process you want to quit without stopping the entire program, then type:

Code:

Taskkill /PID XXXX /F


For example, Taskkill  /PID  5912 /F would terminate the Windows Explorer (File Explorer).

The real power of taskkill are the filtering options. You can use the filters and operators with the /FI parameter.  For example, let's say you want to end all processes that have a window title that starts with "Internet":

Code:

taskkill /FI "WINDOWTITLE eq Internet*" /F


You can terminate all processes running under the FreeBooter account:

Code:

taskkill /FI "USERNAME eq FreeBooter" /F


It is also possible to kill a process running on a remote computer with taskkill.  Just run the following command to terminate notepad.exe on a remote computer called RemotePC:

Code:

taskkill /S RemotePC /U RemoteAccountName /P RemoteAccountPassword /IM notepad.exe /F


To view Taskkill help document, execute following command:

Code:

Taskkill  /?


How Terminate Processes with the Taskkill Command AOZjLLi