wait.com是怎样用的呀?
里面的说明如下:
用法如下
WAIT 秒
最大时间: 1 小时; 默认时间: 无限
返回的Errorlevel值:
0: 超时
1..254: 按键的ASCII码(转为大写)
255: 非ASCII吗键
你的代码可写成
WAIT
if errorlevel 89 goto A 这个ASC是Y
if errorlevel 78 goto B 这个ASC是N
if errorlevel 67 goto C 这个ASC是C
IF ERRORLEVEL 11 GOTO B 这个ASC查出来是“起始位置”
但我写如下代码没有用呀!
wait 5 please input the number "1" or"2"or"3" rem 这儿停5秒 这儿这句正常执行
if errorlevel 49 goto 1 rem 49是1的ASC
if errorlevel 50 goto 2 rem 49是2的ASC
if errorlevel 51 goto 3 rem 49是3的ASC
if errorlevel 0 goto 1 rem 0超时,这儿作用是不按任何键则运行1代码段
if errorlevel 255 goto 1
:error
echo error ekede
goto end
:1
echo 1 is called
goto end
:2
echo 2 is called
goto end
:3
echo 1 is called
goto end
:end
不管按任何键,上面的代码只能运行代码1段,这是为什么?(包括2键和3键)
[ Last edited by brightsm on 2005-11-21 at 19:43 ]
里面的说明如下:
用法如下
WAIT 秒
最大时间: 1 小时; 默认时间: 无限
返回的Errorlevel值:
0: 超时
1..254: 按键的ASCII码(转为大写)
255: 非ASCII吗键
你的代码可写成
WAIT
if errorlevel 89 goto A 这个ASC是Y
if errorlevel 78 goto B 这个ASC是N
if errorlevel 67 goto C 这个ASC是C
IF ERRORLEVEL 11 GOTO B 这个ASC查出来是“起始位置”
但我写如下代码没有用呀!
wait 5 please input the number "1" or"2"or"3" rem 这儿停5秒 这儿这句正常执行
if errorlevel 49 goto 1 rem 49是1的ASC
if errorlevel 50 goto 2 rem 49是2的ASC
if errorlevel 51 goto 3 rem 49是3的ASC
if errorlevel 0 goto 1 rem 0超时,这儿作用是不按任何键则运行1代码段
if errorlevel 255 goto 1
:error
echo error ekede
goto end
:1
echo 1 is called
goto end
:2
echo 2 is called
goto end
:3
echo 1 is called
goto end
:end
不管按任何键,上面的代码只能运行代码1段,这是为什么?(包括2键和3键)
[ Last edited by brightsm on 2005-11-21 at 19:43 ]
