Friday, January 10, 2014

View and kill process from Windows command line

How can you view and kill a process from the command line ?
First you need to know the process id (PID). Check from the task manager as show below

For example here my ireport program has a pid = 5880.

Second, you may directly get it from the command by typing the following in the cmd:
cmd> netstat -ona
 
Three, now comes the time to kill our process.
cmd> taskkill /pid 5880

 If it persists you can force it with a force option ( /F )
 cmd> taskkill /F /pid 5880

You may also search from cmd as follow:
cmd> netstat -ona | find ":80"
cmd>netstat -ona | find "LISTENING"
cmd>netstat -ona | find ":80"  | find  "ESTABLISHED"
and so forth.

No comments:

Post a Comment