下面这个脚本的功能是修改已有的防火墙规则允许192.168.0.0/16,10.0.0.0/8远程windows系统;(保存为BAT文件运行即可)

@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).aspx