@echo off color 1f echo. echo 正在启用Windows防火墙… netsh advfirewall set allprofiles state on > nul echo OK echo. echo 正在关闭TCP135端口… netsh advfirewall firewall add rule name=“BlockIn-TCP135” protocol=TCP dir=in localport=135 action=block > nul echo OK echo. echo 正在关闭UDP135端口… netsh advfirewall firewall add rule name=“BlockIn-UDP135” protocol=UDP dir=in localport=135 action=block > nul echo OK echo. echo 正在关闭TCP137端口… netsh advfirewall firewall add rule name=“BlockIn-TCP137” protocol=TCP dir=in localport=137 action=block > nul echo OK echo. echo 正在关闭UDP137端口… netsh advfirewall firewall add rule name=“BlockIn-UDP137” protocol=UDP dir=in localport=137 action=block > nul echo OK echo. echo 正在关闭TCP139端口… netsh advfirewall firewall add rule name=“BlockIn-TCP139” protocol=TCP dir=in localport=139 action=block > nul echo OK echo. echo 正在关闭UDP139端口… netsh advfirewall firewall add rule name=“BlockIn-UDP139” protocol=UDP dir=in localport=139 action=block > nul echo OK echo. echo 正在关闭TCP445端口… netsh advfirewall firewall add rule name=“BlockIn-TCP445” protocol=TCP dir=in localport=445 action=block > nul echo OK echo. echo 正在关闭UDP445端口… netsh advfirewall firewall add rule name=“BlockIn-UDP445” protocol=UDP dir=in localport=445 action=block > nul echo OK echo. echo. echo 按任意键退出 pause>nul