@echo off@echo 正在设置IPset eth=本地连接set ip=254goto n1:n1netsh interface ip set address name=%eth% source=static addr=10.10.22.%ip% mask=255.0.0.0 gateway=10.10.22.254 gwmetric=0 >nulif not errorlevel 0 set /a ip-=1 & goto n1netsh interface ip set dns name=%eth% source=static addr=202.117.112.3 register=PRIMARY >nulnetsh interface ip add dns name=%eth% addr=218.30.19.40 index=2 >nulexit把IP 网关 DNS 改为你所需的
用DOS命令设置ip地址及DNS 设置/修改IP地址,子网掩码,网关的格式: netsh interface ip set address "本地连接" static 10.25.35.35 255.255.255.0 10.25.35.7 auto 命令的意思是将“本地连接” ip地址设置成 10.25.35.35 子网掩码是 255.255.255.0 网关设置成 10.25.35.7 并且自动跃点数 注意:"本地连接"处请根据自己的情况修改 设置DNS命令格式: netsh interface ip set dns "本地连接" static 211.138.91.1 命令的意思是将“本地连接”的DNS设置成211.138.91.1 删除IP地址和DNS的命令是 netsh interface ip set address "本地连接" dhcp netsh interface ip set dns "本地连接" dhcp