Link to home
Start Free TrialLog in
Avatar of davekatya
davekatya

asked on

Need script to change static IP address for WinXP

I use WinXP Professional at home and office. Although I have the same ISP at both, I am required to change the IP address depending on where I am.

I need one script or batch file that I can run under WinXP that will automatically change my IP from:

172.16.10.23 to 192.168.11.8

Then another script that will change it back.

Hopefully a simple problem if you know how!
Thanks
SOLUTION
Avatar of Fatal_Exception
Fatal_Exception
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
BTW:  the reason you want to make sure to capture everything and make the changes, is that it is highly probable that not only does your IP change, but your default gateway, etc...  especially since it appears that those IP Addresses are on different subnets...  meaning more changes than just IP are needed!  :)

FE
Oh.. if you want to use netsh..  be sure to create your c:\configs directory first to store the output of the command!  :)   Forgot that one point, and noticed after I wrote it that it will obviously bring back an error if the directory does not exist...

FE
ASKER CERTIFIED SOLUTION
Avatar of Rob Williams
Rob Williams
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davekatya
davekatya

ASKER

Thanks to you both for your helpful comments - FE for providing comprehensive info, much more than I needed but very interesting and I'm sure useful for the future.
In the end I split the points but accepted RobWill's answer because all I needed was a batch file with one line in it and everything works as intended:

netsh interface ip set address name = "Local Area Connection" source = static addr = 172.16.10.23 mask = 255.255.255.0

Thanks for the advice!
Thanks Dave,
--Rob
Yep.  thanks..

FE
wow, this is good, im currently looking for answer too, thanks to all of you
Glad we could help!
Exactly the solution I was looking for FE.

Thanks.