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