Two automatic switching IP small scripts in Windows

  

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

1. Switch to automatically get IP

@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

@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, which means setting, the latter two are added, and you replace it yourself. Become a local dns server.

Copyright © Windows knowledge All Rights Reserved