Answer the question
In order to leave comments, you need to log in
How to add several commands to the registry via .reg at once?
Wrote a script that changes the registry branch in
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=in action=allow program=\"%1\""
I need to not only execute a command on clicking a button in the context menu
(netsh advfirewall firewall add rule name=\"% 1\" dir=in action=allow program=\"%1\") but also
netsh advfirewall firewall add rule name=\"%1\" dir=out action=allow program=\"%1\"and
NetSh Advfirewall set allprofiles state off
tried so
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 set allprofiles state off & netsh advfirewall firewall add rule name=\" %1\" dir=in action=allow program=\"%1\" & netsh advfirewall firewall add rule name=\"%1\" dir=out action=allow program=\"%1\""
doesn't work!
The script should, as is clear from the commands, delete all entries in the firewall, then add one button to the context, by clicking the program is added to the permissions for incoming and outgoing,
Thus I plan to protect myself from stealers and warriors.
Answer the question
In order to leave comments, you need to log in
As an option, call a cmd script in the script, in which to place all the commands.
Well, look, both commands work quite well:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\test\command]
@="cmd.exe /c \"echo %1 >xxx.lst && echo %1 >yyy.lst\""
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question