将程序添加防火墙白名单
查考文档:https://support.microsoft.com/en-us/kb/947709
add rule:
netsh advfirewall firewall add rule name="MyApp" dir=in action=allow program="C:\MyApp.exe"
delete rule:
netsh advfirewall firewall delete rule name="MyApp" program="C:\MyApp.exe"
使用批处理将当前目录下的”*.exe”都加入到白名单中:
addfirewall.bat
for %%a in (*.exe) do (
netsh advfirewall firewall add rule name="%%a" dir=in action=allow program="%cd%\%%a"
)