使用netsh設置靜態ip地址
@echo off
netsh interface ip set address "本地連接" static
netsh interface ip set dns "本地連接"
netsh interface ip add dns "本地連接"
pause
使用netsh設置動態ip地址
@echo off
netsh interface ip set address name="本地連接" source=dhcp
netsh interface ip set dns name="本地連接" source=dhcp
pause
From:http://tw.wingwit.com/Article/os/xtgl/201311/10103.html