Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to create shortcut for Windows Firewall rule (enable/disable)?

29 Nov 2013   #1
solshine2510

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 
How to create shortcut for Windows Firewall rule (enable/disable)?

Hello,

hopefully this is right subforum to start this thread
I've googled on how to quickly and easily enable/disable single Windows Firewall rule without having to open the firewall, going into advanced options, and eventually manually finding my rule there.
Best I've found was two commands when searching for 'shortcut':

run, netsh advfirewall firewall set rule name="NameOfFirewallRule" new enable=yes

and

run, netsh advfirewall firewall set rule name="NameOfFirewallRule" new enable=no

Firstly, I don't know how to use them (how do I create shortcut containing the above lines) or if they work at all.
Then, perhaps there is an easier way to quickly disable/enable single rule in Windows 7 firewall?

I did search the Tutorials section here, but only found how to make shortcut for whole Windows Firewall, which is not what I'm after


My System SpecsSystem Spec
.

29 Nov 2013   #2
crankypenguin

Windows 7 Ultimate x64
 
 

I use a program called Windows Firewall Control, which is not a standalone program, rather it gives the Windows 7 platform an easy to use advanced GUI to control rules and edit them as you see fit. Here is the link : Windows Firewall Control
My System SpecsSystem Spec
30 Nov 2013   #3
Alejandro85

Windows 7 Ultimate x64
 
 

Simply put that line in a bat file each, one for enabling, other for disabling, name them as you like and put in desktop or wherever you find them comfortable.

Remember that since firewall is a system-wide setting, you must run them as administrator.
My System SpecsSystem Spec
.


30 Nov 2013   #4
solshine2510

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Thanks for both replies! While the program linked does the job, I'm curious to make the .bat files work as advised by Alejandro85. I put the commands (exactly as typed in first message updated with rule's name) in two txt files, then renamed the extensions to .bat. I right click them and click 'run as administrator', accept UAC prompt, but the cmd windows blinks for a split second and nothing happens, the rule remains in its current state.

Ok I managed to print screen the error message:

C:\Windows\system32\run, netsh advfirewall firewall set rule name="XYZ" new enable=yes
'run' is not recognized as an internal or external command, operable program or batch file.

I've no idea what this means and what to do with it. More help will be appreciated
My System SpecsSystem Spec
30 Nov 2013   #5
Alejandro85

Windows 7 Ultimate x64
 
 

The error says that "run" isn't a known command and Windows don't knows what to do with it. In fact, the "run" thing is wrong, the actual command is netsh, no idea where came that run from. Just start the command with netsh and everything that follows will do.

A handy trick for troubleshooting bat files is to add a "pause" command at the end (in a new line) so it ask you to press a key before closing, giving time for you to read the outcome.
My System SpecsSystem Spec
01 Dec 2013   #6
solshine2510

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Thanks for reply, everything working correctly now
My System SpecsSystem Spec
Reply

 How to create shortcut for Windows Firewall rule (enable/disable)?




Thread Tools





Similar help and support threads
Thread Forum
Keyboard shortcut for disable\enable 2nd screen?
Hey. I'm using a dual monitor (you can see the configuration on the #1 attached image.) I'm not always using the second (not main screen) screen and I wonder if there is a keyboard shortcut to disable (set mode as seen at #2 attached image) or re-enable (as seen at #1 attached image) the 2th ...
Graphic Cards
Shortcut or Hotkey to quickly disable or enable folder options
anyway to do this? shortcut, hotkey? http://i1263.photobucket.com/albums/ii636/TheDarkAvenger85/Forums/folder_options.png
General Discussion
Shortcut to enable & disable device
Hi, is there a possibility to create shortcut (hotkey or another fast method) to disable and enable device (like in device manager)? If not for all device, is it possible for built-in cam and/or microphone? (preferred not by 3rd party aplications)
Hardware & Devices
Windows Firewall with Advanced Security MMC Snap-in -Enable or Disable
How to Enable or Disable Windows Firewall with Advanced Security MMC Snap-in You can use Windows Firewall with Advanced Security to help you protect the computers on your network. Windows Firewall with Advanced Security includes a stateful firewall that allows you to determine which network...
Tutorials
Windows Firewall Shortcut - Create
How to Create a Windows Firewall Shortcut in Windows 7 and Windows 8 Windows Firewall is software that checks information coming from the Internet or a network, and then either blocks it or allows it to pass through to your computer, depending on your firewall settings. This will tutorial...
Tutorials
How can I make shortcut for enable/disable touchpad?
Hello I have a HP 6735s and he has no special key for enabeling/disabeling touchpad. I tried every combination with Function key and its not any of them. Is it any way to make something that turns it off and back on when i want with combination of some keys? Help please..... Thanks
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 04:51.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App