2 November 2012

Closing Windows Processes With CMD (Taskkill)

We all usually when we want to end a running process or service in Windows, use Task Manager. But did you know that you can do the same with Windows command prompt with more options and flexibility. First of all open Run (Win + R), type cmd and hit the Enter key. When the command prompt opened, enter the tasklist command then Enter. Tasklist displays a list of running applications and services along with their process ID or PID for local and remote computer.
You can download the Windows command line reference here. Now to close any service or process, enter

taskkill /pid [PID]

Where PID is the process ID (don’t include the brackets). Let say I want to end the chrome.exe program then my command will be

tasklist /pid 4004

In case you face the error

The process with PID # could not be terminated

Use the /f option to force the cmd to close the service or process.

taskkill /pid  4004 /f