Friday, 16 May 2014

Kill Process based on port number in windows

Most of the time we will be frustrated with address already in bind exception. And we can't find exactly which process is using that port by seeing task manager. So here are the steps given below, to find and kill the process by it's port number.

For example, consider we want to start the tomcat server, which by default takes the 8080 port. But some other resource is already using that port. So follow the below steps to stop the process running on port 8080.

Steps


Find Process:


Command: netstat -a -n -o | findstr 8080

This above command, list the process which is listening on port number 8080.

Kill Process:


Command: taskkill  /PID 6900 /F

The taskkill command kills the process using it's process id. F is used to force kill. But note, taskkill cannot kill the system processes.

Output: