Dec 112017
Branch in batch files based on user input.
File QUESTION.ZIP from The Programmer’s Corner in
Category Batch Files
Branch in batch files based on user input.
File Name File Size Zip Size Zip Type
QUESTION.ASM 9401 2292 deflated
QUESTION.COM 1104 678 deflated
QUESTION.DOC 1642 809 deflated

Download File QUESTION.ZIP Here

Contents of the QUESTION.DOC file

Question V1.0

Copyright (c) 1988 by Techni-Soft. All rights reserved.
8265 Hammond Branch Way, Laurel, MD 20707


This software is not in the public domain. Is is distrubuted
under a Share Ware license. It is provided as is and may be used
for free as long as it is not sold, distributed with this file,
packaged with any other product, or used in a comercial
environment. Requests for exceptions and comercial licenses
should be directed to the author.


This program provides a mechanism for branching in MS-DOS batch
files. It displays a prompt and waits for user to press a key
from a list of choices. The exit code is set based on the number
of the choice entered (e.g. the first choice is exit code 1, the
second is exit code 2, and so on). The exit code can be
determined by the ERRORLEVEL batch command. Rememeber to use the
ERRORLEVEL command in reverse order so that you check for the
highest exit code first.


Question [/]

::= 1 or more characters, not case-sensitive,
blanks are ignored
/ ::= A backslack followed by the user prompt

Sample Batch Programs

Echo Off
Question ynh /Do this is again (y/n)?
If ErrorLevel 2 Goto end
If ErrorLevel 1 Goto start


This program has been tested and runs under MS-DOS 2.x, 3.x &
4.01, OS/2 1.x, and VP/ix under SCO Xenix.

 December 11, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>