home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
batutl
/
batutl2.arc
/
INPUTTST.BAT
< prev
next >
Wrap
DOS Batch File
|
1988-04-16
|
1KB
|
47 lines
ECHO OFF
rem This demonstrates the INPUT program
rem Use the ECHO statements to create a menu, then branch on the keyin
rem You can chain menus by running other batch files.
CLS
ECHO To do the first thing type A
ECHO To do the second thing type B
ECHO To do the third thing type 3
ECHO To do the fourth thing type D
ECHO To do the fifth thing type E
ECHO
rem Notice that the input can be any printable key (but forced to upper case)
INPUT "AB3DE"
ECHO
rem Note that the IF ERRORLEVEL checks for error or HIGHER,so you must test
rem in reverse order (high first)
rem ESC always returns a 255 value
IF ERRORLEVEL 255 GOTO ESC
IF ERRORLEVEL 5 GOTO FIVE
IF ERRORLEVEL 4 GOTO FOUR
IF ERRORLEVEL 3 GOTO THREE
IF ERRORLEVEL 2 GOTO TWO
IF ERRORLEVEL 1 GOTO ONE
:ESC
ECHO You pressed the ESC key
GOTO STOP
:ONE
ECHO You pressed the A key
rem User can run a program here
GOTO STOP
:TWO
ECHO You pressed the B key
rem User can run a program here
GOTO STOP
:THREE
ECHO You pressed the 3 key
rem User can run a program here
GOTO STOP
:FOUR
ECHO You pressed the D key
rem User can run a program here
GOTO STOP
:FIVE
ECHO You pressed the E key
rem User can run a program here
GOTO STOP
:STOP