Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

possible for script to change static ip address?

Status
Not open for further replies.

tarus

Technical User
Jun 11, 2002
5
US
Is it possible for a script (batch file preferably) to change the ip address of a Windows XP Home Edition computer on-the-fly without diabling and enabling the LAN connection?

When I change the "IPAddress" value in [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{7E2A5A5C-B161-4E8F-8F55-6F47D2676685}\Parameters\Tcpip], disable the LAN connection, and enable the LAN connection, then it picks up with the new IP address.

However, I want to be able to disable and enable using a script (batch file), or be able to change the IP address without having to disable and enable again.
 
IP address changes cause the connection to be disabled, then enabled. This is by design. It allows the IP stack to check for the presence of duplicate IP addresses without violating network rules by having two destinations with the same IP address at any time.

Shaith
Network Engineer
MCP, Windows XP
 
Tarus-

This might be a bit of a challenge to accomplish, but I think it can be done. Write a batch file with the following lines

ipconfig /release
ipconfig /renew

And run it as a scheduled task. It would do the trick, if you can get the sceduled task working properly. Jason Wichman
ftp://jwichman.ath.cx:22
 
lol If you use those lines, it creates an infinite batch file that never ends. :)
 
lol If you use those lines, it creates an infinite batch file that never ends. :)
 
Try using the "netsh" command (/? for help on this) It should let you reconfigure your IP settings on the fly from a batch file (XP only)

Willem Luijkx
 
Works on Win2k as well - seems to be NT-specific rather than XP-specific.
Besides: this thread helped me a lot :)
allow thyself to be the spark that lights the fire
haslo@haslo.ch - www.haslo.ch​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top