Quickly Turn ON/OFF Windows Firewall Using Command Line

by [Published on 16 Dec. 2010 / Last Updated on 31 Oct. 2009]

Advertisement GFI LanGuard your virtual security consultant. Scan your LAN for any vulnerability and automate patch management for Windows, Mac OS & Linux. Get your FREE trial now!

GFI LanGuard is the essential tool for sysadmins:

  • Automate multiple OS patching
  • Scan for vulnerabilities
  • Audit hardware and software
  • Run compliance reports

Your FREE trial awaits:

Download a 30 day, fully functional, free trial which also includes GFI technical support.

No credit card required

This article explains how you can quickly Turn Windows Firewall On or Off. This tips applies to Windows Vista, Windows 7 and Windows Server 2008 only!

Windows Firewall on computers running Windows Vista, Windows 7 and Windows Server 2008 is enabled by default. You may need turn it off for various reasons.

This is how you do it using a command prompt:

  • To Turn Off: 
  • NetSh Advfirewall set allprofiles state off
  • To Turn On: 
  • NetSh Advfirewall set allrprofiles state on
  • To check the status of Windows Firewall: 
  • Netsh Advfirewall show allprofiles


See Also

The Author — Nirmal Sharma

Nirmal Sharma avatar

Nirmal Sharma is a MCSEx3, MCITP, and was awarded Microsoft MVP in Directory Services. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles for various online communities. Nirmal can also be found contributing to PowerShell based Dynamic Packs for ADHealthProf.ITDynamicPacks.Net solutions.

Featured Links