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

Contributor Icon Contributed by Rob Rogers  
Tag Icon Tagged: 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.

 

1 Comment -


  1. dannystaple said on April 30, 2009

    Thanks so much. This turned out to be the only sane way to talk someone over the phone through disabling an auto-enabled software firewall (we already have hardware ones).

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -