Contents of the MYMENU.TXT file
MYMENU -- Creates totally customizable menu for batch files.
Selections set Errorlevel for future processing. By Brian E.
One of the slickest ideas I've seen in a while was
encompassed in a program called "BMENU" by Mark Strong. A friend
of mine at work got this off of the DataCom SuperSystems bulletin
board out of Tampa, FL (highly recommended: (813) 796-5627).
This program was loosely based on Norton's ASK command. On the
command line, you were able to specify menu position, title, and
menu choices. Selecting one of them would set the Errorlevel,
which could then be processed while running from a batch file.
This program would work fine with small menus, but inadequacies
become apparent when you need to make a larger menu, or if you
want to change his color scheme.
My program, MYMENU, will display a menu that the user
specifies with a special data file. This is an ordinary text
file containing special commands to configure your menu. You are
able to specify colors, title, position, and menu items. When
this is run from a batch file, the batch processing will be
paused, the menu will be placed on screen, and the user will be
able to use the cursor keys to select a menu item. MYMENU will
set the errorlevel according to the choice the user made: the
first menu item returns errorlevel 0, the second returns 1, third
returns 2, etc. The batch file may test errorlevel and continue
processing based upon the user's selection. Errorlevel testing
must be done from the highest possible value and work down to 0;
that is, if my menu had 4 choices, it would return errorlevels of
0 to 3. In the batch file, you must first test errorlevel 3,
then 2, 1, and 0.
The menu data file allows you to specify menu colors, title
text, menu position, and menu items. This is the format for the
color and position commands...
menu title text
menu item text
The keyword "menu_begin" must be specified between the
color/position commands and the menu title text. Color/position
commands are optional, however "menu_begin" is mandatory, as is
the menu title text. You may have as many menu items as you
The position command is used to specify the position of the
menu. The position specified tells MYMENU where to place the
upper left corner of the menu. The format of the command is:
and are screen coordinates, with
mapping to the upper left corner of the screen.
Color commands allow you to change the default color set,
giving you control of both foreground/background colors for the
menu title, regular menu items, the selected menu item, the
border, and the shadow. The color commands are specified as