Tuesday 22 March 2016

Set IP Address using command in Windows

Some times require to set large number of static IP address in your company. Rather than setting it manually we can use batch file using "netsh"  command to set IP. After that you need to change IP address in batch file and run it on another Computer. "netsh" is windows utility which allows local and remote configuration of network devices. You can use below command to set IP address.

ipconfig /flushdns
ipconfig /release
netsh interface ip set address "Local Area Connection" static 10.195.82.113 255.0.0.0 10.195.82.1
netsh interface ip set dns name="Local Area Connection" static 8.8.8.8
netsh interface ip add dns name="Local Area Connection" 8.8.4.4  index=2
netsh interface set interface "Local Area Connection" disable
netsh interface set interface "Local Area Connection" enabled

where IP Address is 10.195.82.113 Subnetmask :255.255.0.0 Gateway:10.195.82.1 Primary DNS:8.8.8.8 and Secondary DNS is : 8.8.4.4

You may download script file from Here