Windows 10 | regedit | exefile shell command (firewall add rule) - not running

910 views Asked by At

Definitions:

  1. using windows 10/64bit
  2. firewall is blocking all in/out traffic - except added rules (allow in/out)
  3. actual user-account is administrator
  4. tested with all user-account-control (uac) settings: from always to never

Problem:

I have a script that worked fine with windows 7/64 bit, it adds right-click context menu items to .exe files, to add a firewall rule for them:

Windows Registry Editor Version 5.00 
[HKEY_CLASSES_ROOT\exefile\shell]
[HKEY_CLASSES_ROOT\exefile\shell\FirewallAllowIncoming]
[HKEY_CLASSES_ROOT\exefile\shell\FirewallAllowIncoming\command]
@="netsh advfirewall firewall add rule name=\"%1\" dir=in action=allow program=\"%1\""
[HKEY_CLASSES_ROOT\exefile\shell\FirewallAllowOutgoing]
[HKEY_CLASSES_ROOT\exefile\shell\FirewallAllowOutgoing\command]
@="netsh advfirewall firewall add rule name=\"%1\" dir=out action=allow program=\"%1\""

it does not work in Windows 10.

Troubleshooting so far:

following command is working in command prompt (cmd.exe) if running as Administrator:

netsh advfirewall firewall add rule name=\"TEST\" dir=out action=allow program=\"C:\TEST.EXE\"

If not running cmd.exe as Adminstrator, it does not work and it shows a message, that i have to run as Adminstrator.

I believe, it has something to do with the uac - and if the right click context menu commands are clicked, they are not running as administrator and are not executed.

Any suggestions? Thank you.

0

There are 0 answers