netsh為命令列腳本工具,可本地/遠端顯示或修改網路配置,支援批次模式與腳本匯出/匯入。XP SP2後功能大幅增強。
netsh firewall show <項目>)allowedprogram - 顯示允許的程式清單config - 顯示防火牆整體配置currentprofile - 顯示目前設定檔icmpsetting - 顯示ICMP設定logging - 顯示日誌記錄設定multicastbroadcastresponse - 顯示多播/廣播回應設定notifications - 顯示通知設定opmode - 顯示操作模式(開啟/關閉/僅通知)portopening - 顯示開放連接埠service - 顯示服務設定state - 顯示目前狀態netsh firewall set <項目>)allowedprogram - 編輯允許程式清單icmpsettings - 編輯ICMP設定logging - 編輯日誌記錄設定notifications - 編輯通知設定opmode - 編輯操作模式portopening - 編輯連接埠開放service - 編輯服務設定netsh firewall set portopening TCP 8080 "MyApp" ENABLE ALLnetsh即可將防火牆配置納入自動化部署腳本,實現跨機器一致性設定。