Kill a Process by Looking up the Port being used by it from a .BAT

Mike Flynn picture Mike Flynn · Jun 1, 2011 · Viewed 316.2k times · Source

In Windows what can look for port 8080 and try to kill the process it is using through a .BAT file?

Answer

Mohit Singh picture Mohit Singh · Jun 8, 2015

Open command prompt and run the following commands

 C:\Users\username>netstat -o -n -a | findstr 0.0:3000
   TCP    0.0.0.0:3000      0.0.0.0:0              LISTENING       3116

C:\Users\username>taskkill /F /PID 3116

, here 3116 is the process ID