Windows : Add entire subnet in a batch

By | February 19, 2013

Adding a bunch of IP to windows through the GUI is a nightmare! Fortunately, you can enter a single command that will add them in a second.

Simply open the command prompt and type the following command :

Let’s explain every piece of that command :

<IP_START> would be the first usable IP of your range
<IP_END> would be the last usable IP of your range
<IP_SUBNET> is the first three numbers of your range
<IP_NETMASK> is your netmask

In a nutshell, suppose we want to add the following C class : (which represent 32 IPs)

The command would be :

NOTE : If your changed the default interface name (Local Area Connection), you need to enter the new interface name between the double quotes.