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: Netsh firewall issue

30 Aug 2011   #1

Windows 7 Ultimate x64
Netsh firewall issue


I'm trying to add a rule for our program when installing the application. However it doesn't work for a private profile but it does work on a domain profile. Even weirder is when I delete the rule after setup and add the same rule again it does work!

The rule I'm adding during setup (InstallShield) is:

netsh advfirewall firewall add rule name=MyApp dir=in program="c:\myapp\appie.exe" action=allow protocol=UDP edge=deferuser profile=any

When retrieving the rule info (netsh advfirewall firewall show rule name=MyApp) I get:

Rule Name: MyApp
Enabled: Yes
Direction: In
Profiles: Domain,Private,Public
LocalIP: Any
RemoteIP: Any
Protocol: UDP
LocalPort: Any
RemotePort: Any
Edge traversal: Defer to user
Action: Allow

Like I said when I delete the rule and add it again on the command line it does work but the output when retrieving the info is exactly the same !


My System SpecsSystem Spec
30 Aug 2011   #2

MS Windows 7 Ultimate SP1 64-bit


Any reason why you can't use the power of advanced firewall via the control panel?

Control Panel | Window Firewall | Advanced Setings (left-side pane) |
Left-clk on Inbound Rules | rt-clk and choose New Rule |
Program radio button | NEXT |
in This Program Path enter c:\myapp\appie.exe | NEXT |
Allow the connection radio button | NEXT |
checkmark Domain, Public, and Private boxes | NEXT |
enter MyApp in the Name box | FINISH

Now if you really want to worry about the protocol and edge transversal you can either edit the rule OR back at the dialog where you chose Program, you can choose Custom.
My System SpecsSystem Spec
30 Aug 2011   #3

Windows 7 Ultimate x64

Well, I need to do it programmatically during install. I can't bother the end-users with adding/modifying entries to the firewall
My System SpecsSystem Spec

30 Aug 2011   #4

MS Windows 7 Ultimate SP1 64-bit

I suggestyou go ahead and generate your rule using the method I described.

Then try the rule out. Personally, I would block edge transversal.

You can click on your new rule and choose properties. There you will see everything that was set/reset/configured. You can also use the List option and save the list as a .csv file (easier to read than a .txt file). Look at what is there and make corresponding statements in the netsh advfirewall command.

I don't use the netsh advfireall except for the couple of cases where the control panel, wf.msc, or gpedit.msc don't do the job for me.
My System SpecsSystem Spec
31 Aug 2011   #5

Windows 7 Ultimate x64

Thanx for the info! I forgot all about the advanced settings screen. It gives more detailed info then the logging of netsh. It appeared that the installer was adding the rule without path info. It's working fine now.
My System SpecsSystem Spec

 Netsh firewall issue

Thread Tools

Similar help and support threads
Thread Forum
McAfee Firewall issue
Hi, On the Show Hidden Icons (bottom taskbar) McAfee Icon states "Security issue". I check McAfee and it shows the firewall is off. Went to the Control Panel>Windows Firewall. Windows Firewall page shows Home or Work (Private) Network is connected and the Public Network is not connected. This...
System Security
Firewall Issue
Hi All Hope you are all well. First off i apologize if this is in the wrong place. My problem stems from Zonealrm that i have installed on my PC i downloaded the latest version yesterday and since then one game simcity 3000 keeps crashing it worked perfectly well before this also need for...
System Security
Firewall issue
Can somebody tell me how to keep my Firewall turned on once and for all times!?? Whenever I turn on my machine and go "just to check" my firewall....he's turned off. This has been always, I don't know why. Windows issue??? Then I turn it on by pressing " use recommended settings"...
System Security
Not sure if it's a firewall issue, specs issue, or something more...
Hiya Folks I recently bought a new Acer PC running Windows 7 x64. Here's the issue. I can run games locally, and on my local wireless LAN. But when I try to run games online (like via Steam, or Everquest, etc) I can't connect. I have been running through all possibilities such as...
Need Help with the netsh firewall add port opening
Hi All, i'm in a difficult isituation now :o. I need to change the "netsh firewall add portopening .." command to a windows 7 accepted command, so i know that the option to make is to convert it into the following command " netsh advfirewall firewall add rule name .." But my question is. in...
System Security

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 06:27.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App