本机上用的,楼参考下吧:- @echo off&setlocal enabledelayedexpansion
- set /a addr1=1,addr2=71,mask1=254,mask2=255
- set "dns1=134.160.132.40"&set "dns2=202.103.96.112"
- :begin
- cls&set "select="&echo.&set /p select=请选择网关(1 2):
- if "%select%" lss "1" if "%select%" gtr "2" goto begin
- netsh interface ip set address name="本地连接" source=static addr=134.163.144.188 mask=255.255.!mask%select%!.0 gateway=134.163.144.!addr%select%! gwmetric=1
- netsh interface ip set dns "本地连接" static !dns%select%!
复制代码
|