Create a Shortcut Icon or Hotkey to Turn Windows Vista Firewall On or Off
When you are troubleshooting network problems, one of the first things to do is disable the built-in Windows Firewall… but there are just way too many steps required to the firewall on and off. Can't we make a simple shortcut icon instead?
Naturally we can, using the built-in netsh utility that is usually used on the command line to perform advanced networking functions. We'll simply create a shortcut to it with the appropriate parameters.
Note: Always remember to turn the Firewall back on after you are done troubleshooting, especially if you use public wireless networks.
Create Shortcut Icons for Enable/Disable
Right-click on the desktop or elsewhere, and choose New \ Shortcut from the menu.

Then in the shortcut location box, you'll add one of two commands listed below.
Disable Firewall
netsh firewall set opmode disable
Enable Firewall
netsh firewall set opmode enable
Once you've added the correct command, go to the next screen and give the shortcut a helpful name like "Disable Firewall"
At this point you should have a shortcut icon, but it won't work yet without choosing to run as administrator.
Right-click the shortcut and choose Properties, and then choose the shortcut tab.
In this screen you can assign a shortcut key for this shortcut by adding it into the Shortcut key box. The most important step is to click the Advanced button, so we can choose "Run as administrator" to always run the shortcut in administrator mode.

You can also change the icon by using the Change Icon button. If you want the shortcuts to really match, you can change the "Look for icons in this file" to the following:
%SystemRoot%\system32\imageres.dll
In that file you can find the red shield icon as well as the green one…
So now I have two shortcuts that not only look good, but are functional.
If you want to verify that the shortcuts are working, use one of them and then open Windows Firewall through the start menu, and click on the link for "Turn Windows Firewall on or off"

Then you should be able to see that the firewall is either on or off.
The same shortcuts should also work on Windows XP, even though the screenshots are all for Windows Vista. You don't need to run as administrator in XP, of course.
Note: Using these shortcuts will very briefly flash the command prompt window on the screen. For extra credit, you could use the hstart utility in your shortcut to hide the command prompt window.


Nice tip; thanks. I added mine to my quick launch bar so they wouldn't take up desktop space. Using the real icons as a nice, finished look to it.
Personally, since I have a other firewall software installed (Norton Internet Security), I just go to the Services panel in mmc.exe and TOTALLY turn off Windows Firewall. Stop the service, set the Windows Firewall service to manual, and go!
Amazingly, that sped up my Windows Vista computer quite a bit for some reason, while still keeping me reasonably protected.
To turn off Windows Firewall service (if you have a program that contains a built-in firewall): -
1. Click Start, type SERVICES.MSC and press [Enter].
2. Scroll down and then double-click "Windows Firewall".
3. Set 'Startup type' to Disabled, click Apply, click Stop and then click OK.
Now in Windows Firewall, it will say "The Windows Firewall service is not running".
Using XP Pro and XP Home, I have always been under the impression that the Windows firewall was less than effective. Consequently, I chose to install Comodo and disable the Windows firewall. Have I been under a mistaken impression?
Is the firewall in Vista any better than, or is it the same as the XP firewall?
@1fastbullet
The Windows Firewall is excellent, especially for easily blocking traffic coming inbound.
I imagine that some of the other firewalls might do a better job of alerting you when applications try to connect outbound… but really, I've never needed to use anything other than the default one.
Yeah, The Geek has the main reason for using another firewall software correct: Windows Firewall does NOT do well with rejecting outbound connections after something that you do not want manages to get on your computer.
That is the main reason why people upgrade to NIS2008, McAfee's product, or something similar that manages outbound connections in real-time.
@Christopher
Personally I just try and avoid getting spyware on the computer in the first place =)
Nice article but why would you ever want to disable your firewall anyway?
@Chris James: If you're at home or in another safe environment, it's often much easier to play with services with the firewall off than with it on. That's assuming, of course, your network is firewalled.
I recently had to turn mine off for TVersity to work, even though I allowed connections on the ports it was using.
I also agree with "The Geek" about getting malware… just don't get it. Vista helps a _ton_ with that, too, with it's best of breed "nuisance" security — that has a side effect of actually working.
nice article.. thanks
real good one.
%SystemRoot%\system32\imageres.dll
where is the imageres.dll file in WinXP??
Thank You.
@marco: imageres.dll doesn't exist in Windows XP. You can find similar icons on Windows XP in %SystemRoot%\system32\xpsp2res.dll
@jd2066
thank's…