Enable or disable the Windows Firewall with one click

Martin Brinkmann
May 2, 2008
Updated • May 21, 2014
Windows, Windows tips, Windows Vista
|
4

The Windows firewall in Windows Vista and newer versions of Windows cannot be disabled or enabled quickly. A user who wants to enable or disable it would have to open the Control Panel and load the Windows Firewall in the Security tab.

The option to Turn the Windows Firewall on or off appears in the menu. That's not a practicable option if you have to turn it off and on several times a day, maybe every time you switch locations.

Hank (thanks a lot) submitted a tip via email that explains how to enable or disable the Windows Vista Firewall with a simple shortcut, or better two shortcuts. He is using the approach to disable the firewall at home where a hardware firewall is protecting the PC and to enable it when he is using his laptop on the road, for instance at work.

To create the shortcuts right-click the desktop in Windows Vista and select to create a new shortcut from the context menu that opens up. Name the first shortcut Firewall OFF and the second Firewall ON. Use the following two commands to enable or disable the firewall.

Windows Firewall OFF:

%systemroot%\System32\netsh.exe firewall set opmode disable

Windows Firewall ON:

%systemroot%\System32\netsh.exe firewall set opmode enable

A click on Firewall OFF turns the Windows Vista Firewall off immediately and a click on Firewall ON enables it again. To get rid of the command line window in the background right-click the shortcut and select to run the command minimized like in the screenshot above. The default setting is normal window.

Please note that you may need to run the shortcut with elevated privileges. You can do this one-time by right-clicking on the shortcut and selecting the run as administrator option from the context menu.

If you use the shortcut regularly, you may find an automated inclusion of that option helpful. Right-click the shortcut and select properties from the context menu.

Switch to the shortcut tab if not selected already and click on the advanced button. Check the run as administrator box here and click ok. This configures the shortcut to always run with elevated privileges.

The shortcuts use generic icons which you can change as well if you want. To do so click on change icon on the Shortcut tab and select one of the default icons for it or browse to another location on your system to pick an icon from.

One file with lots of icons is %SystemRoot%\system32\imageres.dll. Here you can pick appropriate icons, for instance the red and green shield icons to visualize the off and on functionality.

Summary
Enable or disable the Windows Firewall with one click
Article Name
Enable or disable the Windows Firewall with one click
Description
You can create shortcuts on your system to quickly turn the Windows Firewall on or off on it without having to go into control panel to do so.
Author
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. dougee said on January 15, 2009 at 4:31 pm
    Reply

    Shortcuts must be activated using “Run as administrator”.

    No need to fill in the Start-in input of shortcut form, i.e. can leave as blank.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.