%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit

@echo off 

color 1f 

title 关闭135 137 138 139 445 端口

echo. 

echo. 

echo. 

echo 正在关闭135端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 135 - TCP" dir = in action = block protocol = TCP localport = 135

echo. 

netsh advfirewall firewall add rule name = "Disable port 135 - UDP" dir = in action = block protocol = UDP localport = 135

echo. 

echo 正在关闭137端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 137 - TCP" dir = in action = block protocol = TCP localport = 137

echo. 

netsh advfirewall firewall add rule name = "Disable port 137 - UDP" dir = in action = block protocol = UDP localport = 137

echo. 

echo 正在关闭138端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 138 - TCP" dir = in action = block protocol = TCP localport = 138

echo. 

netsh advfirewall firewall add rule name = "Disable port 138 - UDP" dir = in action = block protocol = UDP localport = 138

echo. 

echo 正在关闭139端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 139 - TCP" dir = in action = block protocol = TCP localport = 139

echo. 

netsh advfirewall firewall add rule name = "Disable port 139 - UDP" dir = in action = block protocol = UDP localport = 139

echo. 

echo 正在关闭445端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 445 - TCP" dir = in action = block protocol = TCP localport = 445

echo. 

netsh advfirewall firewall add rule name = "Disable port 445 - UDP" dir = in action = block protocol = UDP localport = 445

echo.

echo 正在关闭593端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 593 - TCP" dir = in action = block protocol = TCP localport = 593

echo. 

echo 正在关闭1025端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 1025 - TCP" dir = in action = block protocol = TCP localport = 1025

echo. 

echo 正在关闭2745端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 2745 - TCP" dir = in action = block protocol = TCP localport = 2745

echo. 

echo 正在关闭3127端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 2745 - TCP" dir = in action = block protocol = TCP localport = 3127

echo. 

echo 正在关闭6129端口 请稍候… 

netsh advfirewall firewall add rule name = "Disable port 6129 - TCP" dir = in action = block protocol = TCP localport = 6129

echo. 

echo.
net stop server
sc config server start= disabled

net stop LanmanWorkstation
sc config LanmanWorkstation start= disabled

net stop LmHosts
sc config LmHosts start= disabled

net stop Spooler
sc config  Spooler start= disabled 

net stop RemoteRegistry
sc config RemoteRegistry start= disabled 

echo.

echo 按任意键退出 

pause>nul
