将程序添加防火墙白名单

查考文档: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"
)

转载于:https://www.cnblogs.com/jiushishuai/p/9452103.html

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐