windows端口被占用解决方法

windows端口被占用解决方法

1
2
3
4
5
6
7
8
9
10
# 查询端口
netstat -ano
# 查询指定端口
netstat -ano | findstr "端口号"
# 根据进程PID查询进程名称
tasklist | findstr "进程PID号"
# 根据PID杀死任务
taskkill -f -pid "进程PID号"
# 根据进程名称杀死任务
taskkill -f -t -im "进程名称"

如果80端口被系统占用(pid为4),则需要关闭http服务

1
2
3
4
5
6
7
8
# 查看 http 服务的运行状态
netsh http show servicetstate

# 关闭使用上面命令中显示pid号代表的进程
taskkill -f -pid "进程PID号"

netsh http show servicetstate
#没有进程占用就ok了

windows端口被占用解决方法
https://zhstzzy.github.io/2022/06/28/windows端口被占用解决方法/
作者
zhstzzy
发布于
2022年6月28日
许可协议