I got the following code bit for a .REG file, which adds “Add to Firewall” to the context menu by right-clicking on the .EXE file. It simply creates the Source Rule in the Windows Firewall for this particular file that you selected, instead of doing it manually.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell]
[HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall]
[HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall\command]
@="netsh advfirewall firewall add rule name=\"%1\" dir=out action=block program=\"%1\""
http://oi46.tinypic.com/2rgnxaf.jpg
My problem is that the following syntax name=\"%1\"gives the full directory (C: \ New folder \ test.exe) as the name in the Windows firewall instead of the simple test.exe
Another feature I'm looking for is to add all this to the right-click, and not the usual right-click, because I really don't use this function often, so I see it every time I right-click on the. Exe
PS. To remove it from the context menu, do the following:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall]
Hope to hear from someone, and thanks in advance from here;)
source
share