Thursday, August 30, 2012

Kill a Process in Windows

Dear friends,
This time I am writing a common article, how to kill a process which is running
on a port in Windows machine.
In Unix it is quite easier by using below commands:

ps -eaf | grep PROCESS_NAME
kill -9 PROCESS_ID (returned from above command)

But in Windows it is quite strange, see below:

D:\Sandbox\jboss-4.2.3.GA\bin>netstat -o -n -a | findstr 9092
  TCP               LISTENING       7620
  TCP        ESTABLISHED     7620
  TCP         ESTABLISHED     7620
  TCP    [::]:9092              [::]:0                 LISTENING       7620

D:\Sandbox\jboss-4.2.3.GA\bin>taskkill /F /PID 7620
SUCCESS: The process with PID 7620 has been terminated.


No comments:

Post a Comment