Changing an IP address using the command line.
Posted by simonroockley

got it.

you need a text file formatted as in the example below.


#========================
# Interface configuration
#========================
pushd interface

reset all


popd
# End of interface configuration



# ----------------------------------
# Interface IP Configuration
# ----------------------------------
pushd interface ip


# Interface IP Configuration for "Local Area Connection"

set address name = "Local Area Connection" source = static addr = 192.168.0.2 mask = 255.255.255.0
set address name = "Local Area Connection" gateway = 192.168.0.1 gwmetric = 1
# --------------------------------------------
# Add extra gateway example
#---------------------------------------------
# add address name = "Local Area Connection" gateway = 192.168.0.254 gwmetric = 1
set dns name = "Local Area Connection" source = static addr = 192.168.0.1
# --------------------------------------------
# Add extra dns entry example
#---------------------------------------------
add dns name = "Local Area Connection" addr = 192.168.0.254
set wins name = "Local Area Connection" source = static addr = none
popd
# End of interface IP configuration


Then

execute the text file with the command

netsh -f {filename}


Printed from NT Compatible