Kill tomcat service running on any port, Windows
1) Go to (Open) Command Prompt (Press Window + R then type cmd Run this).
2) Run following commands
For all listening ports
netstat -aon | find /i "listening"
Apply port filter
netstat -aon |find /i "listening" |find "8080"
Finally with the PID we can run the following command to kill the process
3) Copy PID from result set
taskkill /F /PID
Ex: taskkill /F /PID 189
Sometimes you need to run Command Prompt with Administrator privileges
Done !!! you can start your service now.
Based on all the info on the post, I created a little script to make the whole process easy.
@ECHO OFF
netstat -aon |find /i "listening"
SET killport=
SET /P killport=Enter port:
IF "%killport%"=="" GOTO Kill
netstat -aon |find /i "listening" | find "%killport%"
:Kill
SET killpid=
SET /P killpid=Enter PID to kill:
IF "%killpid%"=="" GOTO Error
ECHO Killing %killpid%!
taskkill /F /PID %killpid%
GOTO End
:Error
ECHO Nothing to kill! Bye bye!!
:End
pause
netstat -ano | findstr :3010
taskkill /F /PID
But it won't work for me
then I tried taskkill -PID <processorid> -F
Example:- taskkill -PID 33192 -F
Here 33192 is the processorid and it works