#關(guān)閉端口
netsh advfirewall firewall add rule name=禁用TCP端口 dir=in action=block protocol=TCP localport="8080"
#開(kāi)啟端口
netsh advfirewall firewall add rule name=啟用用TCP端口 dir=in action=allow protocol=TCP localport="8080"
#刪除規(guī)則
netsh advfirewall firewall delete rule name=禁用TCP端口
參考:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-560502.html
https://blog.51fuli.info/windows%e9%98%b2%e7%81%ab%e5%a2%99-netsh-advfirewall-%e8%ae%be%e7%bd%ae/文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-560502.html
到了這里,關(guān)于Windows通過(guò)命令開(kāi)啟、關(guān)閉、刪除防火墻規(guī)則的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!