标题: 请帮我看看这个脚本错在哪里,谢谢
[打印本页]
作者: ziver
时间: 2006-6-4 08:00
标题: 请帮我看看这个脚本错在哪里,谢谢
刚开始学习批处理
这个简单的脚本为什么每次都跳到First.
懂得的朋友帮忙解释一下,谢谢了
还有,能介绍一下choice返回值的方式吗
@echo off
:start
choice /C:FSTO /M "First,Second,Third,Out"
if errorlevel 1 goto First
if errorlevel 2 goto Second
if errorlevel 3 goto Third
if errorlevel 4 goto end
:First
echo This is the first line.
goto start
:Second
echo This is the Second line.
goto start
:Third
echo This is the Third line.
goto start
:end
echo bye!
作者: electronixtar
时间: 2006-6-4 10:49
ErrorLevel x 是指 大于 或等于 x 的情况!所以要倒着写!
if errorlevel 4 goto end
if errorlevel 3 goto Third
if errorlevel 2 goto Second
if errorlevel 1 goto First
初学者编ErrorLevel最易范的错误 ^_^
chioce的用法自己看帮助!
Last edited by electronixtar on 2006-6-4 at 10:51 ]
作者: 220110
时间: 2006-6-4 10:50