下面有错误的语句已经加重,此句只要加"gateway=192.168.0.254"就错。为什么?
-----------------------------------------------
:start
echo 1.重新配置
echo 2.自动获取网络配置
echo 3.退出配置
set /p select=请选择任意一选项继续:
if "%select%"=="1" goto select1
if "%select%"=="2" goto select2
if "%select%"=="3" goto select3
goto nothing
:select1
set /p %ip=请输入您的IP(格式为192.168.0.*): netsh interface ip set address name="本地连接" source=static addr=%ip% mask=255.255.255.0 gateway=192.168.0.254
netsh interface ip set dns name= "本地连接" source= static addr= 218.2.135.1 primary
goto end
:select2
netsh interface ip set address name="本地连接" source=dhcp
netsh interface ip set dns name="本地连接" source=dhcp
goto end
:select3
goto end
:nothing
echo 你没有选择任何选项,程序将退出。
goto end
:end
pause作者: slore 时间: 2008-5-12 18:19 t /p ip=请输入您的IP(格式为192.168.0.*):作者: sevenwang2000 时间: 2008-5-12 18:33 已经解决
[ Last edited by sevenwang2000 on 2008-5-12 at 09:37 PM ]作者: cnLiou 时间: 2008-5-12 22:07 标题: 我写了一个.希望你能用得着.