@echo off
:start
cls
echo.
echo "修改\添加\备份"您电脑IP地址的设置
echo.
echo.
echo 修改本地IP地址-----------1
echo 添加一个IP地址-----------2
echo 备份本机IP地址-----------3
echo.
echo;
set /p ii=请添入相应的修改项目(1 or 2 or 3):
set ii=%ii:~0,1%
if "#%ii%"=="#1" goto A
if "#%ii%"=="#2" goto B
if "#%ii%"=="#3" goto C
cls
echo.
echo;
echo:
echo.
echo.
echo 您输入了错误的数字!!!
echo -_-.-_-.-_-.-_-.-_-
echo.
echo;
echo;
echo;
pause
goto start
:A
cls
set /p yy=输入IP地址(格式:192.168.1.1):
set /p uu=输入子网掩码(格式:255.255.255.0):
set /p oo=输入网关地址(格式:192.168.1.11):
netsh interface ip set address "本地连接" static %yy% %uu% %oo% 1
cls
echo 修改完毕!
netsh int ip show address
goto end
:B
set /p yy=输入IP地址(格式:192.168.1.1):
set /p uu=输入子网掩码(格式:255.255.255.0):
netsh interface ip add address "本地连接" %yy% %uu%
cls
echo 添加完毕!
netsh int ip show address
goto end
:C
set /p mm=输入备份文件的位置(例如: "c:\"):
netsh -c int ip dump>%mm%.\本机IP备份文件.txt
cls
echo 备份完毕!
:end
set yy=
set uu=
set oo=
set ii=作者: doscc 时间: 2006-3-27 13:18 顶作者: kingchain 时间: 2006-3-28 15:15 请教楼主SET /P什么意思?
跟CHOICE 同样吗?作者: shangmeng 时间: 2006-4-1 13:16 好。以后多多发。作者: martin325 时间: 2006-4-3 20:49 这个有意思的作者: rom320320 时间: 2006-4-3 22:12 有没有基础的作者: xtfcujj 时间: 2006-4-7 22:12 没有基础啊行不啊?作者: lxmxn 时间: 2006-7-23 17:22 标题: 高!
# ----------------------------------
# 接口 IP 配置
# ----------------------------------
pushd interface ip
# "本地连接" 的接口 IP 配置
set address name="本地连接" source=static addr=192.168.0.99 mask=255.255.255.0
set address name="本地连接" gateway=192.168.0.200 gwmetric=0
set dns name="本地连接" source=static addr=202.97.224.68 register=PRIMARY
add dns name="本地连接" addr=202.97.227.138 register=PRIMARY
set wins name="本地连接" source=static addr=none