How do I enable Windows Firewall via command line?
This article discusses how to enable Window Firewall from a command line interface.
Open Windows Command Prompt
- Open command prompt using one of the following methods:
- Windows key + R —> type cmd —> click OK.
- Star menu —> type run and open applet —> type cmd —> click OK.
Enable Windows Firewall
- Enable Windows Firewall by running the following commands:
netsh advfirewall set domainprofile state on netsh advfirewall set privateprofile state on netsh advfirewall set publicprofile state on
Verification
Run the following command to check the current state (ON or OFF) for all three firewall profiles:
netsh advfirewall show allprofiles state Domain Profile Settings: ---------------------------------------------------------------------- State ON Private Profile Settings: ---------------------------------------------------------------------- State ON Public Profile Settings: ---------------------------------------------------------------------- State ON Ok.