@echo off
echo 1.修改为网关为192.168.0.1电信DNS
echo 2.修改为网关为192.168.1.2 网通DNS
echo 3.IP自动获取,DNS自动获取。
set/p x=请选择
if "%x%"=="1" goto dx
if "%x%"=="2" goto wt
if "%x%"=="3" goto zd
goto :eof
:dx
netsh interface ip set address 本地连接 static 192.168.0.100 255.255.255.0 192.168.0.1 1
netsh interface ip set dns 本地连接 static 202.102.152.3 primary
ipconfig/all
pause
goto :eof
:wt
netsh interface ip set address 本地连接 static 192.168.1.100 255.255.255.0 192.168.1.1 1
netsh interface ip set dns 本地连接 static 61.233.154.33 primary
ipconfig/all
pause
goto :eof
:zd
netsh interface ip set address 本地连接 static dhcp
netsh interface ip set dns 本地连接 static dhcp
ipconfig/all
pause
温馨提示:答案为网友推荐,仅供参考