端口被占用?两步解决端口占用问题

Arxon:

写了一个批处理脚本 只需要输入端口即可

[code=plain]

[/code]

::关闭打印

@echo off

::获取端口号

netstat -aon|findstr %1

::获取进程号

for /f "tokens=5" %%i in ('netstat -aon^|findstr %1') do set pid=%%i

::关闭进程

taskkill /pid %pid% /f