标题: 请教WIN XP下choice 不能用了,怎么办?
[打印本页]
作者: xyqxt
时间: 2007-6-21 23:08
标题: 请教WIN XP下choice 不能用了,怎么办?
@echo off
echo Select
echo y you select yes
echo n you select no
echo
choice /c:yn
if not errorlevel 1 goto exit
if errorlevel 1 goto yes
if errorlevel 2 goto no
:yes
echo yes select
goto exit
:no
echo no select
goto exit
:exit
像上面这个例子应该怎么处理呢? 请各位老师指导..
作者: zh159
时间: 2007-6-22 02:06
从2003复制一个,或在论坛找找
作者: HAT
时间: 2007-6-22 10:06
用set命令
@echo off
echo hello world
echo press "y" to continue press "n" to exit
set /p input=
if %input% equ y (
goto yes
) else (
goto no
)
:yes
echo continue
:no
作者: icydawn
时间: 2007-6-22 14:01
0:
set /p input=
if %input% =y goto 1
if %input% =n goto 2
goto 0