【批处理】用netsh管理防火墙示例

下面这个脚本的功能是修改已有的防火墙规则容许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

相关文章
相关标签/搜索