CMD命令行netsh添加防火墙规则


1.为e:\f.exe 添加防火墙规则(参考:https://www.cnblogs.com/zhen656/p/4275270.html),需要管理员权限。

>netsh advfirewall firewall add rule name="f.exe" dir=in program="e:\f.exe" action=allow

删除

netsh advfirewall firewall delete rule name="f.exe" 

 2、添加端口

netsh advfirewall firewall add rule name="HTTP" protocol=TCP dir=in localport=8080 action=allow

删除

netsh advfirewall firewall delete rule name="HTTP" protocol=TCP dir=in localport=8080 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM