Changing an IP address using the command line.

Does anyone if it is posible to change the ip address of a Win2K or NT4 PC using the command line. Thanks in advance. .

Windows Networking 2246 This topic was started by ,


data/avatar/default/avatar27.webp

44 Posts
Location -
Joined 2000-03-06
Does anyone if it is posible to change the ip address of a Win2K or NT4 PC using the command line.
 
Thanks in advance.

Participate on our website and join the conversation

You have already an account on our website? Use the link below to login.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


data/avatar/default/avatar33.webp

723 Posts
Location -
Joined 2000-02-05
If u using DHCP, u can "release" and "renew" the IP from the DHCP pool

data/avatar/default/avatar27.webp

44 Posts
Location -
Joined 2000-03-06
OP
No i'm trying to do it with static IP addresses.

data/avatar/default/avatar27.webp

44 Posts
Location -
Joined 2000-03-06
OP
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}

data/avatar/default/avatar19.webp

3857 Posts
Location -
Joined 2000-03-29
That's pimpy, I was gonna dig up an article on doing it with Windows Scripting Host but this looks pretty cool. I will have to check that out sometime.