choice command

B

Bill Stewart

alex said:
does anyone know where i can get a choice command that will run in dos
mode? thanks

Hi,

What do you mean by "DOS mode"? Windows NT 4.0, 2000, XP, etc. do not have
a "DOS mode"; see:

http://home.comcast.net/~stewartb/cmdprompt.html#9

Win9x/Me does have DOS mode because it boots from a real-mode MS-DOS
kernel.

If you need a keystroke input utility that's an actual MS-DOS executable,
you can use my freeware getkey utility:

http://home.comcast.net/~stewartb/getkv.html

Getkey is a keystroke input tool that sets ERRORLEVEL, like choice. Getvar
is a line-input tool that sets an environment variable. The download
includes MS-DOS and Win32 console versions of both programs.

Regards,

Bill
 
R

Ray McCormick

alex said:
does anyone know where i can get a choice command that
will run in dos mode? thanks

If the query is 'what do I use in W2k instead of the 'choice'
command in Win9x then the answer is to use the 'SET' command (see
set /?)

I use the following to branch from a single-digit input:

(SET Choice=)
(SET /P Choice=Type the number and press Enter or Return: )
:: Reduce input to a single digit and test if valid
IF "%Choice%" NEQ "" SET Choice=%Choice:~0,1%
if x%choice% == x GOTO :NotValid
ECHO:
if %choice% GEQ 0 if %choice% LEQ 9 goto:item%choice%


Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top