Statistiche

Windows tip: change IP address with a script


How to change IP address of interface from command line on Windows XP:

Step1: create a batch file

netsh -c "interface ip" -f Sample.Config
ipconfig
pause

Step2: create the config file “Sample.Config”

set address name=
"Local Area Connection (LAN)" source=static addr=10.0.0.7 mask=255.255.255.0 gateway=10.0.0.254 gwmetric=1
set dns name="Local Area Connection (LAN)" source=static addr=10.0.0.250
add dns name=“Local Area Connection (LAN)" addr=10.0.0.251 index=2

The interface name (in red) must be the Windows name of the interface.

Step 3: execute the batch file Winking

I’ve created many profiles for different customer sites, this way is faster than using the GUI and manually change the values.

HTH