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

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

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

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

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

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

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 for2: How to create shortcut for Windows Firewall rule (enable/disable)?
Thread Forum
Keyboard shortcut for disable\enable 2nd screen? Graphic Cards
Solved Shortcut to enable & disable device Hardware & Devices
Windows Firewall with Advanced Security MMC Snap-in -Enable or Disable Tutorials
Windows Firewall Shortcut - Create Tutorials
How can I make shortcut for enable/disable touchpad? 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 09:17 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33