Batch adding multiple ip addresses to Windows server with netsh

Posted on 08. Aug, 2009 by config in Windows

Ever wanted to add 200 ip addresses to Windows Server with one command instead of manually configure it on the interface? Netsh will help you to save time.
You can use this quick batch command in cmd:
FOR /L %I IN (2,1,254) DO netsh interface ip add address "Local Area Connection" 10.0.0.%I 255.255.255.0

This example will add ip addresses from 10.0.0.2 to 10.0.0.254 with 1 step each time.
You can play with this example and change the place of %I to say add ip addresses from 10.0.1.1 to 10.0.200.1 and so on.
Do not forget to change the name of the interface ( "Local Area Connection" ) to the exact name of the interface you would like to use.

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • FriendFeed
  • LinkedIn
  • MySpace
  • Netvibes
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter
  • Twitthis

Tags: , , , , , ,

One Comment

Stoked!

23. Apr, 2010

Freakin awesome!!! THANKS!

Leave a reply