使用netsh設置靜態ip地址:
@echo off
netsh interface ip set address "本地連接" static 172.24.83.239 255.255.255.0 172.24.83.247
netsh interface ip set dns "本地連接" 172.24.102.110
netsh interface ip add dns "本地連接" 172.24.102.110 index=2
pause
使用netsh設置動態ip地址:
@echo off
netsh interface ip set address name="本地連接" source=dhcp
netsh interface ip set dns name="本地連接" source=dhcp
pause