Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 493 Posts 228 Joined 2007-02-16 00:38 19-year member UID 79596 Gender Male From 安徽
Status Offline
The choice command can be used to let the user enter a character to run different commands. When using it, the /c: parameter should be added. After c:, the characters that can be entered should be written without spaces in between. Its return code is 1234...
For example: choice /c:dme defrag,mem,end
Will display
defrag,mem,end?
For example, the content of test.bat is as follows:
@echo off
choice /c:dme defrag,mem,end
if errorlevel 3 goto defrag should judge the highest error code first
if errorlevel 2 goto mem
if errotlevel 1 goto end
:defrag
c:\dos\defrag
goto end
:mem
mem
goto end
:end
echo good bye
Why can't the choice command be executed under CMD on my WINXP???