How to kill a process from the command line in Window
tasklist
taskkill
windows
Here is how to kill a process from the command line in Windows.
First, you need to find the PID. To do this run the tasklist
command: this will display all the applications that are currently running. If you know the .exe filename you can filter out the result list by using the /fi
option. For example here is a command to find the PID for eclipse.exe:
C:\>tasklist /fi "IMAGENAME eq eclipse.exe"
and the output is:
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
eclipse.exe 13304 Console 1 794,480 K
Once you have the PID you can run the taskkill
command to close the application.
C:\>taskkill /PID 13304
if everything is going well, you should be able to see a message like:
SUCCESS: Sent termination signal to the process with PID 13304.
or, if something fails, you can get a message like:
ERROR: The process with PID 13304 could not be terminated.
Reason: This process can only be terminated forcefully (with /F option).
or, if you are not a local administrator, you will get a message like:
ERROR: The process with PID 13304 could not be terminated.
Reason: Access is denied.