The following tutorial will show you how to add IP addresses in batches through command lines in windows. Target: In the NIC named "Local Connection" of the Local Machine, add IP addresses in the range of 192.168.1 in batches. The starting IP address is 10. Add 1 each time until 22 is known, that is, the three parameters in brackets.
Add IP addresses bound to NICs in batches
Method 1
Run the following command on the CMD command line:
For/L % I in (10, 1, 22) Do netsh interface IP add address "Local Connection" 192.168.1.% I 255.255.255.0
Method 2
Create a BAT file with the following content:
@ Echo off
For/L % A in (10, 1, 22) Do netsh interface IP add address name = "Local Connection" ADDR = 192.168.1.% A mask = 255.255.255.0
Batch Delete the IP addresses bound to the network card. [perform the following operations when the network card IP address is bound.]
Run the following command in cmd:
Step 1: netsh-C int IP dump> C: \ ip.txt
In the C root directory, an ip.txt file is displayed, which contains the settings of the current nic. in order to better understand the IP address settings.
Step 2:
Edit this file and delete the IP address you want to delete in IP. txt.
Step 3:
Netsh-f c: \ ip.txt
Re-import the IP address of the NIC information to the NIC.