WinXP system automatically switch IP settings tutorial

  
1. Switch to automatically get IP
The following is a code snippet:
@echo off
netsh interface ip set address name=“local” source=dhcp
netsh Interface ip set dns name=“local” source=dhcp
2. Switch to 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 2 fixed IPs, change the second script yourself:)
dns settings, the first one is set, indicating the setting, the latter two are added, replace it with local 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 two small scripts, huh, huh, the drug is sick.

Copyright © Windows knowledge All Rights Reserved