New
#1
netsh advfirewall add- how to prevent multiple entries by command line
Hi
Iīm using a little script to enter "add rule" to the firewall in Win 7
f.e.
netsh advfirewall firewall add rule name="Firefox Updater" dir=out program="%ProgramFiles% (x86)\Mozilla Firefox\updater.exe" enable=yes profile=any action=allow
This works fine so far.
But if i start the script again, it will create the same rule AGAIN (with the same name and everything).
Can I prevent this? Maybe I need some unique identifier that prevents double entries?
Or should I better check - using some if/else commands - if a rule exists and if not add it (but how do i do THAT?).
I donīt want to create a lot of single script files, i just want to use one which i might extend with new entries if a new tool is coming along. I know this might not be the nicest solution for a security matter, but itīs fine for me
Aside from that, if someone is doing the same thing or something similar, are you still using the batch cmd or are you on Power Shell?
Thanks a lot!