windows系統(tǒng)下要關(guān)閉端口,使用批處理命令可很快解決
一鍵關(guān)閉危險(xiǎn)端口.bat
@echo off color 1f title 關(guān)閉常見的危險(xiǎn)端口echo 正在開啟Windows防火墻echo.netsh advfirewall set currentprofile state on > nulnetsh advfirewall set publicprofile state on > nulecho. echo 防火墻已經(jīng)成功啟動。echo. echo. pause cls echo 正在關(guān)閉常見的危險(xiǎn)端口,請稍候… echo. echo 正在關(guān)閉135,139,445端口… netsh advfirewall firewall add rule name='135_139_445' protocol=TCP dir=in localport=135,139,445 action=blockecho 正在關(guān)閉137,138端口… netsh advfirewall firewall add rule name='137_138' protocol=UDP dir=in localport=137,138 action=blockecho 常見的危險(xiǎn)端口已經(jīng)關(guān)閉。 echo. echo. echo. echo. echo. echo 按任意鍵退出。 pause>nul