windows7查看和关闭占用的端口

1. 查看占用的端口

cmd 后输入命令:netstat -aon|findstr [要查的端口]

如欲查端口1099,输入:netstat -aon|findstr 1099

2. 关闭占用的端口

得到1中查询结果后,记住pid,输入命令:taskkill -f -pid [被占用端口PID]

如将上例查询端口关闭,则输入如下命令:taskkill -f -pid 7748

原文地址:https://www.cnblogs.com/zhcBlog/p/9907959.html