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.
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%
I think you can find your answer in one of these 1052 postings
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.