Compatible Support Forums: Changing an IP address using the command line.

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Changing an IP address using the command line.

#1 User is offline   simonroockley 

  • newbie
  • Group: Members
  • Posts: 44
  • Joined: 06-March 00

Posted 01 May 2002 - 11:37 AM

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

Thanks in advance.
0

#2 User is offline   Palos 

  • old hand
  • Group: Members
  • Posts: 723
  • Joined: 05-February 00

Posted 01 May 2002 - 02:11 PM

If u using DHCP, u can "release" and "renew" the IP from the DHCP pool
0

#3 User is offline   simonroockley 

  • newbie
  • Group: Members
  • Posts: 44
  • Joined: 06-March 00

Posted 01 May 2002 - 05:09 PM

No i'm trying to do it with static IP addresses.
0

#4 User is offline   simonroockley 

  • newbie
  • Group: Members
  • Posts: 44
  • Joined: 06-March 00

Posted 01 May 2002 - 07:24 PM

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}
0

#5 User is offline   clutch 

  • Carpal Tunnel
  • Group: Moderators
  • Posts: 3859
  • Joined: 29-March 00

Posted 01 May 2002 - 08:18 PM

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users