Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 572
Mike Flynn Avatar asked Jun 01 '11 15:06

Mike Flynn


People also ask

How do I kill a .bat file?

bat add the following code: call taskkillapp. bat [filenamehere] . And to taskkill.


1 Answers

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

like image 61
Mohit Singh Avatar answered Oct 27 '22 00:10

Mohit Singh