禁止联网
创建防火墙规则-禁止当前程序联网,并且默认开启此规则。
1 | netsh advfirewall firewall add rule name="RULE-QQ" dir=out program="D:\Program Files\QQ\Bin\QQ.exe" action=block |
name:设置规则名字,e.g.
RULE-QQ
program:设置程序绝对路径
开启联网
关闭已创建的规则
1 | netsh advfirewall firewall set rule name="RULE-QQ" new enable=no |
删除规则
1 | netsh advfirewall firewall delete rule name="RULE-QQ" |