Vista / Server 2008: Enable or Disable Firewall from the Command Line

Posted June 19, 2008 by Rob Rogers in Microsoft Vista

Instead of using the GUI, you can enable and disable the Windows Firewall from the command line. A must for any command line junkie.


You will need to use an elevated command prompt to do this.
1. Click the Start button.

2. Click All Programs and select Accessories.

3. Right-click Command Prompt and select Run as administrator.

To Enable the Windows Firewall, use the following:
netsh advfirewall set currentprofile state on

To Disable the Windows Firewall, use the following:
netsh advfirewall set currentprofile state off

After the command has been executed, the prompt will return an Ok when the Firewall has been enabled/disabled.

 

About Rob Rogers

Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.
View more articles by Rob Rogers

The Conversation

Follow the reactions below and share your own thoughts.