[英]Kill tomcat service running on any port, Windows
杀死运行在任何端口上的 tomcat 服务,Windows 使用像 8080/8005 这样的命令提示符
1) Go to (Open) Command Prompt (Press Window + R then type cmd Run this). 1)转到(打开)命令提示符(按Window + R然后键入cmd Run this)。
2) Run following commands 2)运行以下命令
For all listening ports对于所有监听端口
Apply port filter应用端口过滤器
Finally with the PID we can run the following command to kill the process最后使用PID,我们可以运行以下命令来终止进程
3) Copy PID from result set 3)从结果集中复制PID
Ex: taskkill /F /PID 189例如:taskkill /F /PID 189
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.