- @echo off
- echo .
- echo .
- echo 本机网络属性:
- netsh interface ipv4 show address
-
- CHOICE /C:YN /M "修改本机网络属性,确认请按 Y,否请按 N。"
-
- if errotlevel 1 goto mod
- if errorlevel 2 goto end
-
-
- :mod
- echo 配置本机网络属性:
- set slection0=
- set/p slection0=请输入IP地址:
- set slection1=
- set/p slection1=请输入子网掩码:
- netsh interface ip set address name="本地连接" source=static addr=%slection0% mask=%slection1%
- set slection2=
- set/p slection2=请输入网关地址:
- netsh interface ip set address name="本地连接" gateway=%slection2% gwmetric=0
- set slection3=
- set/p slection3=请输入主dns地址
- netsh interface ip set dns name="本地连接" source=static addr=%slection3% register=PRIMARY
- set slection4=
- set/p slection4=请输入备份dns地址
- netsh interface ip add dns name="本地连接" addr=%slection4%
- netsh interface ip set wins name="本地连接" source=static addr=none
- echo 本机新的网络属性:
- netsh interface ipv4 show address
- pasue
-
- :end
复制代码 选择Y后提示如标题 |