DOS Menu Master V1.3 User's Manual Stuart A. Jones MD April, 1984 Copyright (C) Stuart A. Jones MD, 1983, 1984 Copyright (C) Stuart Jones 1984 Page 1 Table of Contents Introduction........................................3 Installation Instructions...........................5 Routine Operation...................................7 Theory of Operation................................12 Advanced Applications..............................13 Copyright (C) Stuart Jones 1984 Page 2 Introduction This manual describes installation, routine use, and the operation of the DOS Menu Master program. This program is designed to free the occasional user of IBM PC-DOS (R) or Microsoft MS-DOS (R) from having to learn the operating system commands necessary to perform such routine operations as listing the directory of a diskette, copying files from diskette to diskette, formatting fresh diskettes, etc. Menu Master does this by first giving the user a menu of operations to choose from. The user is then asked additional questions pertaining to his choice. The program then alters a DOS batch file (a set of commands to the operating system, held in a diskette text file). The user can then go back to the menu, and choose another operation, if he so desires. When the user is finished with the menu program, the batch file is then automatically fed to DOS, which then executes each of the commands. This version of the program is designed for use with PC-DOS version 1.1 (MS-DOS version 1.25), and with PC-DOS version 2.x (MS-DOS version 2.x) on computer systems WITHOUT a 'fixed disk' (or hard disk). The advanced hard-disk directory management features of PC-DOS V2.0 and MS-DOS V2.1 are not directly available to the user via this version of Menu Master. Version 2.0 of Menu Master is specifically designed to work with the more advanced versions of PC-DOS and MS-DOS. If you are not certain which version of DOS you are using, ask your computer dealer. In any case, you may feel free to try to use Menu Master V1.1 with your computer system. The worst that is likely to happen is that the commands created by Menu Master will not work, or that the Menu Master program itself will fail to operate. Loss of data on the diskette being used to test Menu Master is unlikely, but, if you are in doubt, please use a spare copy of your DOS diskette for experimentation! Although this program is designed for the novice computer user, anyone wishing to operate this program MUST understand what a 'file' and a 'volume' are. A 'volume' is, for the purposes of both DOS and Menu Master, a single diskette and the data contents thereof. Before data can be written on a diskette, a pattern of magnetic pulses called the 'format' must be written on the diskette, and a specific area on the diskette which is used to hold a directory of data contents must be cleared ('initialized'). Data can then be written on the diskette, in the form of 'files'--organized collections of data, each of which is assigned space on the diskette by DOS, and each of which has an entry in the directory, which serves as a form of index to the data. Files are identified to DOS by means of a 'File Name'. The File Name is in two parts--a name, up to 8 characters, and beginning with a letter, and an extension, up to 3 characters. The name and extension are separated by a period ('.') You are encouraged to read the material pertaining to files and their naming in your DOS manual. Volumes are identified to DOS according to the diskette Copyright (C) Stuart Jones 1984 Page 3 drive in which they currently reside. At present, volumes may be named (in PC-DOS V2.0 and MS-DOS V2.1), but the volume names are not operationally significant. The diskette drives are labelled 'A:' (or 'a:'), 'B:', 'C:', etc. These labels refer to the actual physical position of each diskette drive. For example, on the IBM Personal Computer, the A: drive is that on the left. You are again encouraged to read about disk drive naming in your manuals. With this information and Menu Master, it is possible to perform most routine DOS file and volume maintainance activities without learning the exact DOS commands required. You will be exposed to these commands, since they are displayed as DOS executes each one. The batch files you create can also be saved for later use, if you desire. Menu Master is a copyrighted product of Nuclear Software of Allentown, Pa. This program is distributed as 'Share-ware'. You are encouraged to copy and share this program with your friends and associates. If you, or they, find this program worthwhile, you are encouraged to send a contribution of $20 to the address below. This will enroll you among the registered users of Menu Master. As a registered user, you will receive notice of updates and improvements in the program, as well as information about other products from our company. Contributions, questions and comments should be referred to: Nuclear Software 1045 Treeline Dr. Allentown, Pa. 18103 Copyright (C) Stuart Jones 1984 Page 4 Installation Instructions These instructions explain how to copy the Master Menu program MMENU.EXE from the distribution diskette to your DOS Master diskette, and how to run MMENU to set up the necessary batch file. In order for DOS to successfully carry out all commands built into MMENU, the following files should be present on your DOS Master diskette: CHKDSK.COM DISKCOPY.COM DISKCOMP.COM BASICA.COM FORMAT.COM If you wish to 'lock out' a command (such as FORMAT, which can be abused to accidentally destroy the contents of an entire diskette), leave the appropriate file off your DOS Master diskette. Installation of MMENU can be completed in five easy steps: 1) Place your DOS Master diskette in drive A:, and the MMENU distribution diskette in drive B:. If you have only one drive, insert into it the DOS Master diskette. 2) Type the following: copy b:mmenu.exe a: ('' means press the 'enter' key (just above 'PrtSc' on the IBM PC and most look-alikes)) 3) If you have only one diskette drive, DOS will tell you to insert the 'B:' diskette. Insert the distribution disk. When DOS tells you to insert the 'A:' diskette, insert the DOS Master diskette. 4) When the copy operation is complete, type: cmenu The menu will be displayed, after some diskette reading and writing. 5) Press the 'F9' key. In response to the next question (Execute Prior Commands?), type . After some more disk activity, the computer will print the 'A>'prompt . You are now back at DOS command level. At this point, you have created a batch file--'menu.bat', as well as a data file, 'menu.dat'. These files are used to run the Menu Master program automatically. MMENU alters 'menu.bat', and loads this file with the commands you select from the menu. Apart from MMENU.EXE, which requires 28K characters of diskette storage space, the files involved take up little space on diskette. Advanced users may wish to install MMENU on an 'electronic disk' in upper main memory. MMENU and its supporting Copyright (C) Stuart Jones 1984 Page 5 DOS programs require a minimum 64K character 'electronic disk'. If you are a novice with a 'big' computer with plenty of memory and 'electronic disk' programs available, by all means try out MMENU on 'electronic disk'. Copyright (C) Stuart Jones 1984 Page 6 Routine Operation The DOS Menu Master Program is run by typing: menu. MMENU.EXE cannot be effectively used outside of the batch file, menu.bat. In routine operation, the altered batch file menu.bat will be executed by DOS immediately after you finish using MMENU. When menu.bat is run, the last command executed will be 'menu'-- which starts up MMENU again. When MMENU begins operation, it erases the previous version of menu.bat, and reads the number of the operation chosen last from the menu from menu.dat. MMENU next reads the file menu.app, which holds a subsidiary menu of applications commands set up by you or your computer dealer. MMENU then displays the menu: File Maintainence: 1 - List Directories of Disk(s) 2 - Copy File(s) 3 - Display/Print Text File Volume Maintainence: 4 - Format Diskette in Drive B: 5 - Copy Entire Diskette Contents Other: 6 - Run a DOS Program or Batch File 7 - Run a BASIC Program 8 - Exit to BASIC 9 - Exit to DOS 10 - Run Application From Menu Default -- Repeat Last Operation Your choice: In response to the prompt, 'Your choice: ', you may enter a number from 1 to 10, or press a function key. Press 'F1' to select choice 1, 'F2' to select choice 2, etc. etc. MMENU will then ask one or more questions depending on which option you chose. After you have answered the questions, you will be asked, in most cases, '(C)ontinue or (E)xecute? '. If your reply begins with the letter 'c' (either capital or lower-case), MMENU will return you to the menu for another choice. If you choose to 'execute', MMENU saves the number of your last chosen operation in menu.dat, finishes setting up menu.bat, and exits. At this point, if you are running automatically, menu.bat is executed by DOS. The questions asked pertaining to each menu choice, and the Copyright (C) Stuart Jones 1984 Page 7 default answers to them, are described below. Please note that a 'default' answer is one assumed by MMENU if you only press in reply to a question. 1 - List Directories of Disk(s) The first question is: (A)ll or (S)elected Files? The default answer is All. Your reply must begin with the letter 's' if you wish to list selected files. If you do, the next question is: File Name (name.ext): You may, at this point, enter a file name using so-called 'wild card' notation. For example, to list all files with the name 'demo', you would enter: demo.*. To list all files with the extension BAS (i.e. all BASIC programs), you would enter: *.bas. 'Wild cards' are explained in the section of your DOS manual dealing with file names. By all means, read this section. If you have selected 'All' files, or after you have entered a file name, the next question is: Disk Drive (A, B, C...): Enter the single letter corresponding to the disk drive in which currently resides the volume whose directory you wish to see. If you enter a colon (':') after the letter, don't worry; MMENU will recognize your answer anyway. The default is the drive in which resides the diskette you are currently using to run MMENU. You will then be asked: (R)egular or (W)ide? The default is 'regular'. The directory, in this form, will appear as a single column of file names, each with a size in characters and a creation date. If more than 24 files are in the directory, the listing will pause until you strike a key. The wide form (selected by entering a reply beginning with letter 'w') displays file names only, in four columns, and will pause for you to strike a key only at the end of the display listing. The next question is: Check Free Space? The default answer is 'yes'. After the directory listing, program CHKDSK will be run. This program displays both disk space utilization and main memory size. You will then again be asked to press a key to continue. You will then be asked to Continue or Execute. 2 - Copy File(s) The first question is: Source Device (A, B, C... or CON): You may enter a single letter for the diskette drive holding the volume containing the file(s) you wish to copy, or specify CON, in which case you can create a single file typing from the keyboard, a process described in your DOS manual. Creating a text file from CON: is NOT RECOMMENDED unless you know EXACTLY what you are doing. This can be a useful 'quick and dirty' way of creating text files without using a text editor. If the file you are creating is to be more than 4-5 lines long, better use EDLIN.COM, or a word-processing program if you have one. The next question asked is: File Name (name.ext): Again, you may use 'wild card' notation to specify a group of files to be copied. A default reply returns you to the menu. The next question is: Destination Device (A, B, C... or Copyright (C) Stuart Jones 1984 Page 8 LPT1). Enter a letter for the disk drive holding the destination volume. If you enter: lpt1:, the files will be copied to your lineprinter, if you have one. If you specify the lineprinter as the destination, at this point, TURN IT ON. Trying to copy to an inactive lineprinter will only cause an error message in most versions of MS-DOS (including all versions of PC-DOS), but MAY 'hang up' the computer (cause it to mysteriously stop functioning, in which case you must turn it off and then back on again). The final question is: Destination File Name (name.ext): A default answer causes the file(s) to have the same name on the destination volume as on the source volume. If you enter a file name, do so CAREFULLY, as this effectively changes the name of the file you are copying to this new name. Be especially careful if you use 'wild cards'. The best answer to this question is usually a default. You can always rename files later, using the DOS 'rename' command (q.v. in your Friendly DOS Manual). 3 - Display/Print Text File You are first asked: Disk Drive (A, B, C...): Enter a drive letter, as above. You are then asked: File Name (name.ext): You may use a 'wild card', but this is not recommended, as multiple files specified with a 'wild card' will be displayed or printed without a break between files. The last question is: (C)onsole or (P)rinter? The default is 'console'--i.e. displaying file contents on the screen. Your reply must begin with letter 'p' to specify hard copy. 4 - Format Diskette in Drive B: If you select this option, you are planning to write format data on a (hopefully) previously blank diskette in disk drive b:. Please, before proceeding, INSERT THE BLANK DISKETTE IN DRIVE B:!!! Formatting the diskette will ERASE ALL DATA currently residing upon it! As such, formatting is useful for 'bulk erasing' diskettes with potentially sensitive data you no longer need. You will be asked only one question: Copy DOS? The default reply is 'yes'. The formatted diskette will then be usable as a DOS system diskette. If you wish to use the diskette for data only, your reply must begin with letter 'n'. You will, of course be asked to Continue or Execute. Once again, PLEASE BE CAREFUL when exercising this option. 5 - Copy Entire Diskette Contents You will be asked: Source Disk Drive (A, B, C...): and then: Destination Disk Drive (A, B, C...): A default to either question will cause the copying operation to misfire. No harm will result; but no copying will, either. If you mistakenly enter the same answer to both questions, MMENU will point out your error, and return you to the menu. You will then be asked: Verify Copy? Copyright (C) Stuart Jones 1984 Page 9 The default answer (a good one--strongly recommended) is 'yes'. To suppress verification (checking that the copying was exact), your reply must begin with letter 'n'. The DOS program DISKCOPY is used to execute this option. When menu.bat is executed by DOS, and DISKCOPY is run, you will be instructed by DISKCOPY to insert source and target volumes in the disk drives you have specified. Please, BE CAREFUL!!! If you place the disk you are copying in the wrong drive, you may WIPE IT CLEAN!!! or worse, copy old data over new data!! For maximum protection, WRITE PROTECT the disk you are 'backing up'! If you have specified verification, the DOS program DISKCOMP is run, which checks that the original and the copy are identical. 6 - Run a DOS Program or Batch File You are asked: Source Disk Drive (A, B, C...): Once again, the default is the drive you are currently using. You are then asked: Program/Batch File Name (name only): You need not specify a file extension to answer this question. Indeed, you need not specify a file name. This option inserts whatever you type in reply to the second question into the batch file, menu.bat (optionally preceded by a disk drive specification). Once you are comfortable with DOS commands, you can use this option to build some pretty slick batch files. You can also use this option to perform 'delete' or 'rename' operations--but this is NOT RECOMMENDED. Indeed, you may be wondering by now why 'Delete File(s)' or 'Rename File(s)' are not options in the menu. These commands were not overlooked. They are not included because the author believes fervently that they should NEVER be included in a batch file; the potential for disaster is just too great. Novices, in particular, should rename or delete files with GREAT caution, and preferably without using 'wild cards'. (Just why MICROSOFT did not include safeguards against wholesale mistaken deletion or renaming of files is beyond me (and most other observers).) End of sermon. You should of course be aware of the way DOS works when presented with a program name for execution. DOS is told to run a program by entering the name of the program (with or without extension). If no extension is specified, DOS searches the directory of the specified diskette for a file with the specified name and one of three extensions (COM, EXE and BAT). DOS first looks for a file with the COM extension, then for one with the EXE extension, and last for one with the BAT extension. It is best not to have programs with the same name and different extensions, or programs and batch files with the same names. (This is why MMENU.EXE is named MMENU.EXE and not MENU.EXE, which would work, but be confusing.) Copyright (C) Stuart Jones 1984 Page 10 7 - Run a BASIC Program You are asked: Source Disk Drive (A, B, C...): Then you are asked: BASIC Program Name (name only): A default reply will start up BASICA, without loading and executing a BASIC program. You must, if you specify a program name, enter the name only. The extension BAS is assumed. 8 - Exit to BASIC You are asked: Execute Prior Commands? The default answer is 'no'. If your reply begins with letter 'y', all the commands put in menu.bat are retained, and will be executed by DOS before BASICA is executed; after you leave BASICA (via a SYSTEM command), MMENU will automatically be run again. If not, all previous options you chose are discarded. If you discarded all previous options, when you leave BASICA, MMENU will NOT automatically be run; you will, instead, be returned to DOS command level. You may then run MMENU either automatically or semi-automatically, as described above. You will NOT be asked, (C)ontinue or (E)xecute? after selecting this option; execution commences forthwith after you answer the question. 9 - Exit to DOS You are asked: Execute Prior Commands? The default is 'no'. If your reply begins with letter 'y', menu.bat will be executed by DOS immediately, if you are running MMENU automatically. If not, all prior commands selected by you will be discarded, and you will be left at DOS command level, regardless of how you are running MMENU. As for Option 8, MMENU will exit forthwith after you answer the question. This option provides an 'escape hatch' if you have made a mistake with a prior command; if you answer `no` to the question, the contents of menu.bat will be erased, and you can start over. 10 - Run Application From Menu When MMENU starts up, it looks for the file menu.app, a text file which holds a subsidiary menu of DOS commands which run specific applications programs. If this file is not found, this option cannot be used. In this case, if Option 10 is selected, MMENU says: No Applications Present Press any Key to Continue If you press any key, you will be returned to the main menu. Menu.app is a standard text file, which can be created using EDLIN or any other text editor or word processor. The first line of this file is an integer number between 1 and 10, representing the number of applications command lines in the remainder of the Copyright (C) Stuart Jones 1984 Page 11 file. Each subsequent line consists of a menu item (displayed for the user to select from), followed by one or more DOS command lines. The menu item is separated from the command line(s) by an up-arrow ('^'); individual command lines are also separated by an up-arrow. As an example, suppose that file menu.app has the following contents: 2 Run Visicalc^a:vc80 Copy DIF Files and Delete^copy c:*.dif b:^del c:*.dif When Option 10 is selected, the screen is cleared, and the following menu is displayed Applications Menu 1 - Run Visicalc 2 - Copy DIF Files and Delete Your Choice: You then choose from this menu as from the main menu (i.e. by entering a number or pressing a function key). If you enter 0, or default, you will return directly to the main menu. If you were to enter: 1 in this example, the command line: 'a:vc80' would be added to menu.bat. If you entered: 2, the command lines: 'copy c:*.dif b:' and 'del c:*.dif' would be added to menu.bat. More experienced users can easily create their own applications menus. Novices should use the applications menu supplied by their friends or dealer. Copyright (C) Stuart Jones 1984 Page 12 Theory of Operation The techniques used by Menu Master are quite simple. DOS batch files may chain to each other; therefore, if a program run via one batch file creates or modifies the next batch file chained to, the program effectively controls the DOS command flow. The implications of this observation may be profound for developers of integrated software systems. MMENU represents a very simple-minded model for interaction of a program with its batch environment. Were it possible to 'lock out' the user from interfering with batch execution (as it is in many operating systems for larger computers), this technique could be used to create modules capable of interaction via the batch process itself. Perhaps, in future MS-DOS releases, this will become possible. At present, the DOS command interpreter keeps track of the name of the batch file being executed, and the line position in that file of the next command. This consideration is used for altering the current contents of the batch file being run by DOS at the time MMENU is executed. At entry, MMENU deletes the current contents of menu.bat, and writes 'cmenu' as its first line. Subsequent commands are appended to the file, which is closed when MMENU exits. DOS then picks up execution of menu.bat with the second line, and proceeds to the last line, which is 'menu' unless 'Exit to DOS' or 'Exit to BASIC' has been chosen. Copyright (C) Stuart Jones 1984 Page 13 Advanced Applications In this section, more advanced DOS users may find a few 'tricks' they can perform using MMENU. Changing the Default Disk Drive Using Option 6, it is possible to insert a drive specification alone into menu.bat. This effectively changes the 'logged-in' or default disk drive. The author has successfully used this trick to install MMENU on an 'electronic disk' and resume automatic operation. (Creating the batch file for THIS trick is left as an exercise for the reader.) This may be necessary when a program to be run expects to find related files on the same diskette. One should remember to change the default drive back to its original value after such a program is run; otherwise, automatic menu operation will cease when menu.bat is not found on the new drive (this may be a desirable side effect in some cases, though). 'Electronic Disk' If sufficient memory space is available, MMENU and its related files may be held on 'electronic disk'. This dramatically improves performance of MMENU (indeed, this makes Menu Master a reasonable enhancement for even fairly advanced users). If programs to be run must reside on disks in physical drives, one can either specify the source drive for programs manually or change default disk assignment as above. Some 'electronic disk' driving programs can be activated from within a batch file, and will create an 'electronic disk' without restarting DOS. Such programs can be particularly useful in managing a batch stream. Starting Menu Master From 'Cold Boot' Advanced users who are configuring system disks for less experienced individuals may wish to start automatic operation of MMENU on startup by adding the command, 'menu' as the last command in autoexec.bat. MMENU operation from 'electronic disk' could also be begun thus. PC-DOS 2.0 Commands The Applications Menu can be used to operate a fixed-disc branching directory with minimal pain to the user. Options in this menu can be set up by the computer dealer to switch directories and start up an application within and using the new directory without additional user intervention. DOS V2.0 commands can, of course, also be put in batch files which may be invoked either via the Applications Menu or using Option 6 to run the batch file by name. Note, however, that if you wish to Copyright (C) Stuart Jones 1984 Page 14 return to the menu automatically, the last command in such a batch file MUST be 'menu'. If you wish to return to the menu only sometimes, insert a comment instructing the user to press 'control-break' to exit the batch file, and then insert a 'pause' command. Copyright (C) Stuart Jones 1984 Page 15