|
Question : 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
|
Answer : Need script to change static IP address for WinXP
|
|
Fatal_Exceptions answer is extremely thorough, and using the "dump" option is the better way to go.. However, if you want specific examples of netsh batch files, I have included 2 below. Both run then display current config and pauses for you to view. You can remove the last 2 lines. 1st is for static IP, second for DHCP. Substitute your values/IP's as necessary. The network connection name is assumed to be the default "Local Area Connection".
*************************************************** rem Reset network Settings for static IP netsh interface ip set address name = "Local Area Connection" source = static addr = 10.0.0.99 mask = 255.255.255.0 netsh interface ip set address name = "Local Area Connection" gateway = 10.0.0.254 gwmetric = 1 netsh interface ip set dns name = "Local Area Connection" source = static addr = 24.222.0.1 netsh interface ip add dns name = "Local Area Connection" addr = 24.222.0.2 netsh interface ip show config pause
*************************************************
rem Reset network settings for DHCP netsh interface ip set address name = "Local Area Connection" source = dhcp netsh interface ip set dns name = "Local Area Connection" source = dhcp netsh interface ip set wins name = "Local Area Connection" source = dhcp netsh interface ip show config pause
|
|
|