views:

10

answers:

0

Using a little app, I have a few lines that look like the following:

netsh firewall add portopening name = "__Auto_WebAccess_TCP_80_IPCount=501_0" protocol = TCP profile = CURRENT mode = ENABLE scope = CUSTOM port = 80 addresses = ip addresses , e.g. 84.22.55.22 and son on comma separated

Problem is, the maximum characters you can put in one command line string is 8192, so now I have several netsh commands as above, but with slightly different names.

Anyway, they replace each other rather than append.

How do I make the command append and create a new rule each time, but with different IP Addresses? You can do it through the GUI, but can't figure it out through netsh.

Oh, its web server 2007, so you can't use netsh advfirewall, only firewall.

Thanks