16

I use the following command to allow listening of specific HTTP ports:

netsh http add urlacl url=http://+:[port]/ user=DOMAIN\UserName

But if I need to open a range of ports, can I setup a single rule?

Igor Semenov
  • 483
  • 5
  • 13

1 Answers1

12

I didn't find any way to specify a range so I went with using built-in FOR command:

for /L %i in ([port_start],1,[port_end]) do netsh http add urlacl url=http://+:%i/ user=DOMAIN\UserName

You can get more info on the FOR command by using 'FOR /?' in command prompt. /L happened to be the one that worked for me because it builds a set of numbers given start, stop and step values.

censored
  • 131
  • 1
  • 3
  • 1
    Not sure why this was downvoted but it worked perfectly for me... `for /L %i in (32000,1,32099) do netsh http add urlacl url=http://+:%i/ user="NT AUTHORITY\NETWORK SERVICE"` – Basic May 13 '15 at 11:58