If you need to bulk add IPs to a Windows server (2003 or 2008) one of the following batch scripts will make that much easier.

Example one:
This example will add a range of IPs as specified between the parentheses. Here are the values used in the example below:
2 = Starting octet
1 = Value to increment
5 = Ending octet

FOR /L %%i IN (2,1,5) DO netsh in ip add address "EXT" 192.168.1.%%i

This will add through to the connection labeled “EXT”.

Example two:
If you have a list of IPs that need to be added in a text file, the following batch script can be used. Ensure that each IP is on a new line:

FOR /F %%i IN (IPs.txt) DO (
netsh in ip add address "EXT" %%i

Make sure “IPs.txt” is the name of your file, “EXT” is the name of your connection, and the netmask ( is correct for your range.

Leave a Reply