win 关闭正在使用的端口

1、Windows平台 

在windows命令行窗口下执行:

1.查看所有的端口占用情况

C:>netstat -ano

2.查看指定端口的占用情况

C:>netstat -aon|findstr "8000"

3.查看PID对应的进程

C:>tasklist|findstr "18000"

4.结束该进程

C:>taskkill /f /t /im python.exe

原文地址:https://www.cnblogs.com/fmgao-technology/p/9560461.html