kill_port.bat
set serverPid= for /F "tokens=5 delims= " %%P in ('netstat -a -n -o ^| findstr :96 ') do set serverPid=%%P if not "%serverPid%" == "" ( taskkill /F /PID %serverPid% ) else ( rem echo Server is not running. )
备注:
1,96为端口号
2,点击即可执行,如果想要看执行过程的话:在文件所在处,Shift + 鼠标右键→在此处打开命令窗口→输入kill_port.bat(或输入k,按Tab键自动补全),按Enter键执行