WinXP system automatically switch IP settings tutorial

  

1. Switch to automatically get IP
The following is the code snippet:
@echo off
netsh interface ip set address name=“local” source=dhcp
netsh interface ip set dns name = & ldquo; local & rdquo; source = dhcp

2. switched to the fixed IP
the following is the code snippet:
@echo off
netsh interface ip set address Local static 192.168.0.84 255.255.255.0 192.168.0.254
netsh interface ip set dns local 192.168.0.254
netsh interface ip add dns local 202.106.196.115 index=2
netsh interface ip add dns local 202.106.0.20 Index=3
“local” is your local NIC name, or it may be "local connection", you need to replace it yourself. If it is a switch between two fixed IPs, change the second script yourself:)
In the dns setting, the first one is set, indicating the setting, the latter two are added, and the local one is replaced with the local one. Dns server.

From the office to the home environment, or from the conference room to the IP switch on the office workstation, I believe that you have been bothered by the trouble, then use the following 2 small scripts, huh, huh, the drug is sick .

Copyright © Windows knowledge All Rights Reserved