socket端口绑定后通过bat干掉

@echo off
::port为需要去绑定端口
set port=8888
for /f "tokens=5 delims= " %%a in ('netstat -ano ^|findstr /c "%port%"') do (
echo pid=%%a
taskkill /f /pid %%a
GOTO :OUTFOR
)
:OUTFOR
pause

posted on 2017-05-21 23:22  chairmanming  阅读(242)  评论(0编辑  收藏  举报