- @echo off
- echo.
- echo.
- echo 设置本机IP地址
- echo.
- echo.
- set /p Addr=请输入您的IP地址:
- for /f "tokens=1-3 delims=." %%a in ("%Addr%")do set Gateway=%%a.%%b.%%c.1
-
- echo.
- echo 正在修改设置,请稍候……
- ::修改IP地址
- netsh interface Ip set address name="本地连接" source=static Gwmetric=0 Gateway=%Gateway% Addr=%Addr% mask=255.255.255.0 >nul
- ::修改DNS
- Netsh interface IP Set dns "本地连接" static 202.102.10.220 primary >nul
- echo. 完成
复制代码
|