@echo off
set port=443
set /P port="請輸入要關閉的端口,默認443:"
rem if "%port%" == "" (set port=443)
echo 開始搜索'netstat -ano^|findstr ":%port%" '
for /f "delims=" %%i in ( 'netstat -ano^|findstr :%port%' ) do set pid=%%i
set id=%pid:~-5%
echo 使用端口%port%的進程pid:%id%;開始結束它
TASKKILL /PID %id% /F
pause
exit;