0

I am trying to add a large block of IP addresses to our NIC in Server 2008 R2. For some reason this isn't working from the command line or from a batch file though.

FOR /L %A IN (131,1,190) DO netsh interface ipv4 add address "Local Area Connection" 206.217.129.%A 255.255.255.192

I am getting the message "A wasn't expected at this time" although from looking at it the syntax appears to be correct.

Aidan Knight
  • 650
  • 3
  • 11
  • 19

1 Answers1

2

If you're running it from cmd, %A is fine, if you're running it from a batch, it should be %%A.

MDMarra
  • 100,734
  • 32
  • 197
  • 329
  • Ah that makes sense, thank you. Is there a reason they don't show up in the IPv4 settings? – Aidan Knight Jun 03 '11 at 21:43
  • @Brett - They should, where are you looking? I don't really have any experience adding 60 IPs to a single interface, that's a pretty unusual situation, so I'm not sure how Windows dialogues handle that. – MDMarra Jun 03 '11 at 21:46
  • Yeah, I have no idea why we had such a large block assigned to the machine. We generally just add /29 and /28 blocks as needed. Anyways, thanks for the help! – Aidan Knight Jun 03 '11 at 21:54