Often intranet, external network switch, modify IP is very troublesome, write a script, double-click to fix. Used for a long time, today to share.
Modified to automatic acquisition, Setipauto.bat
echo off
netsh interface ip set address name= "Local Area Connection" source=dhcp
netsh interface ip set DNS name= "Local Area Connection" Source=dhcp
Echo finished
... echo "Start ping:www.baidu.com"
ping www.baidu.com
Pause
Modify fixed IP (and DNS)
Setipxxx.bat
echo off
netsh interface ip set address name= "Local Area Connection" Source=static addr=17.25.72.56 mask=255.255.255.0 gateway= 17.25.72.254 gwmetric=1
Echo set IP success
... netsh interface ip set DNS name= "Local Area Connection" Source=static addr=17.28.19.31 register=primary
echo Set Primary DNS success. ....
netsh interface ip add DNS name= "Local Area Connection" addr=17.28.19.32 index=2
Echo Set second DNS success
... Echo Finished
... Pause
Copy it down, then double-click it.