@echo off:aset port=echo.&set /p port=输入端口号:clsif not defined port goto :afor /f "tokens=2,4,5" %%a in ('netstat -ano^|find /i ":%port% "') do if not "%%c"=="" (set pid=%%c) else (set pid=%%b)for /f "tokens=1" %%a in ('tasklist /fi "pid eq %pid%"') do set prog=%%ataskkill /f /fi "pid eq %pid%"echo.&echo 按任意键退出pauseexit