下面這個腳本的功能是修改已有的防火牆規則容許192.168.0.0/16,10.0.0.0/8遠程windows系統;(保存爲BAT文件運行便可)windows
@echo off echo "Start Windows Firewall..." netsh advfirewall set allprofiles state on echo "Set Remote Desktop (TCP-In)'s RemoteIP='192.168.0.0/16,10.0.0.0/8'" netsh advfirewall firewall set rule name="Remote Desktop (TCP-In)" new RemoteIP="192.168.0.0/16,10.0.0.0/8" echo "Set Remote Desktop - RemoteFX (TCP-In)'s RemoteIP='192.168.0.0/16,10.0.0.0/8'" netsh advfirewall firewall set rule name="Remote Desktop - RemoteFX (TCP-In)" new RemoteIP="192.168.0.0/16,10.0.0.0/8" pause
Netsh命令參考網址:http://msdn.microsoft.com/zh-cn/library/cc778925(v=ws.10).aspxide