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

  1. Open command prompt using one of the following methods:
    1. Windows key + R —> type cmd —> click OK.
    2. Star menu —> type run and open applet —> type cmd —> click OK.

Enable Windows Firewall

  1. 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.