Windows的cmd命令查询指定端口占用的进程并关闭

以端口8080为例:

1.查找对应的端口占用的进程:netstat  -aon|findstr  "8080"    ,找到占用8080端口对应的程序的PID号:

2.根据PID号找到对应的程序:tasklist|findstr "PID号"    ,找到对应的程序名

3.结束该进程:taskkill /f /t /im 程序名

 

参考:1. http://jingyan.baidu.com/article/72ee561ab81a2ae16138dfcc.html

2.http://jingyan.baidu.com/article/3c48dd34491d47e10be358b8.html

posted @ 2019-02-25 10:43  y-xs  阅读(5720)  评论(0编辑  收藏  举报