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