Вы находитесь на странице: 1из 9

DOS 6.2 CONFIG.SYS Menu's for Dummies or How to make multiple configurations run on your computer.

Several people on CompuServe Tandy and IBM forums have asked how to utilize the DOS 6.2 menu commands in the CONFIG.SYS and AUTOEXEC.BAT files to create multiple configuration selections for the computer. Since MicroSoft in their push to conserve paper <G> put most of the information how to do this in the Help command 'On-Line', and not in the 'hard-copy' manual, it's hard to create your new CONFIG.SYS and AUTOEXEC.BAT files and access the 'Help' at the same time. Of course, you can PRINT out the various help files that refer to the various menu commands, but an example in front of you, is worth more than the hassle of going between the manual, DOS Help command and re-entering your ASCII text editor, to create a working file. I. Definitions of CONFIG.SYS command items for multiple configurations: (All taken straight form DOS 6.2 HELP text file.) DOS 6.2's 'HELP' note <Multi-Config Commands> states: "A single CONFIG.SYS file can define several different system configurations. To define multiple configurations, you use the following special CONFIG.SYS commands: " <Menucolor> <Menudefault> <Menuitem> NOTE: the additional commands <Include> and <Submenu> are not included in this 'BASIC' example. Definitions: A. [menu]: header block tells the booting system that multiple configurations are included in the CONFIG.SYS file. This is always the first item at the start of the CONFIG.SYS file. B. Menucolor: is a command to create color information for the menu screen. syntax menucolor=x[,y] where x= color of text. Valid values from 0 to 15 where y= Optional color of background. Valid values from 0 to 15. If not included default color is black background color values: 0 1 2 3 4 Black Blue Green Cyan Red 5 6 7 8 9 Magenta Brown White Gray Bright Blue 10 11 12 13 14 Bright Bright Bright Bright Yellow green 15 Bright white cyan red magenta

NOTE: according to DOS 6.2 values from 8 to 15 on some systems will cause the screen to blink. Always test before making a final color statement. example: menucolor=15,1 (Bright white text on Blue background) C. Menudefault: is a command that specifies to the system the default configuration that the computer uses if no selection is made during startup after a specified time. This command can only be used within the menu block of the CONFIG.SYS file. If it is not included the default is set to menu-item 1. syntax menudefault=blockname[,timeout] blockname is the name of the default selection to be run. [,timeout] is the optional amount of time the system counts down from waiting for a key selection. If the timeout is reached without a valid key selection the default selection is automatically selected. Valid values are from 0 to 90 seconds example: menudefault=Home, 15 (Home menuitem is selected after 15 seconds countdown delay.) D. Menuitem: defines an item in the startup menu. It is used only within the menu block of the CONFIG.SYS file. Maximum number of Menuitems is 9. Each Menuitem is a choice that appears on screen when the system boots up. Each is the EXACT title of a choice block that follows the menu block syntax menuitem=blockname[,menu_text] blockname is the EXACT title of the associated configuration block. The configuration block must be defined elsewhere in the CONFIG.SYS file. If it is selected from the menu, MS-DOS carries out the commands in the block as well as any commands listed in the CONFIG.SYS file before the [menu] block and and commands contained in the [common] header block. NOTE: if MS-DOS cannot find a block with the specified (EXACT) name the name will not appear on the startup menu. Maximum length of the block name is 70 characters. Excluded characters are (/), (\), (,), (;), (=) and ([,]). ,menu_text specifies the EXACT text MS-DOS will display for this menu item. If not specified MS-DOS will display the menu block name as the menu item. Maximum of 70 characters with all printable characters available. example: menuitem=Home, Home Ram Drive C: External Drive D: (defines the Home menu block and what is displayed on the configuration menu screen for this block. II. Procedure for creating CONFIG.SYS Menu file:

A. Define what configurations you require for your computer. Examples are: 1. Different users, Single option: Do different users of the computer require different configurations? ie: Does Joe require networking and Jane doesn't. Does Jane need only to start Windows, Does Jack only require a statistical program to run. Each of these decisions can create a menuitem option for the menu. 2. Different options, Single user: Do you require the computer to start different programs or does the requirements for various programs require diferent resources (Memory, Drivers, etc) ie: Portables connected at home to devices or equipment you don't take on the road. A Database program that requires different devices that your word processor program doesn't need. That BIG game you play requires more memory than your normal configuration has available. Again, each of these choices creates a menuitem option. 3. Different users, Multiple options: Do your different users require different options at different times? Although I didn't have this problem you can either create menuitems with different titles for the same user. ie: Jane-WP, Jane-DB, Joe-1, Joe-2, for example, or use the Submenu command for nested configurations within a menuitem. I haven't touched on this command because, I haven't used it. Other 'experts' can probably provide the expertise to use this command. B. Determine the resources required for each menuitem. On a separate piece of paper for each menu choice, determine what resources and CONFIG.SYS file commands are needed for each choice you require. After you are satisfied that the required items are listed, place the choices next to each other and compare the items to find common items that the entire menu can use. Any Common items can be placed in to a menuitem labeled Common and deleted from the other menuitem blocks. Also decide the title of the menu choice that you want to appear on the Menu screen, It should be descriptive enough so you can quickly decide which configuration you want to run. C. Test your configuration blocks. Once you decide what each configuration should contain, make sure that each will operate by making temporary CONFIG.SYS and AUTOEXEC.BAT files to test each choice. This should insure that they operate without problem, before you combine them in large files that can be hard to 'Debug'.

NOTE: Don't do this to your CONFIG.SYS and AUTOEXEC.BAT files that run you computer now, either save you present files so you can go back to your current configuration, or create a 'Boot diskette' with all the required resoures and use it to 'cut and paste' until you are satisfied. Once you have created your final CONFIG.SYS and AUTOEXEC.BAT files then you can copy them to your normal boot harddrive or diskette. HINT: Since it's easy to 'loose' root files when making changes to your CONFIG.SYS and AUTOEXEC.BAT files, the safest thing that I've found to prevent this is to create a "Backup" directory with copies of the curent CONFIG.SYS and AUTOEXEC.BAT files placed in it, along with any other files that you want to protect. (COMMAND.COM, Batch files, etc.) D. Asssembling CONFIG.SYS Everything checks out? Now comes the 'hard' part putting the files together so that they work. Place your configuration blocks in the order you want them to appear on the menu screen and then start your ASCII word processor or DOS's edit program. (Look at figs 1.1 and 1.2 for my examples) Lines 1 thru 9: define the menu screen line 1: menu block header line 2 thru 7: define the menu choices and what is printed on screen. NOTE: The bock item name must be the exact spelling of the menu block you want to run. line 8: menucolor tells the system what colors to use on the screen. line 9: menudefault what menu choice to use if I don't select a choice within 30 seconds. Lines 10, 15, 22,28,33,38: separates the configuration blocks from each other. Lines 11,16,23,29,34,39: Are the configuration block headers. Their spelling must agree with the choices in the menu header block above. Lines 11 thru 14: Common configuration block. What common resources are common to all possible choices for systems configurations. Lines 16 thru 21: Sample config block. What I want the Normal configuration to use. Note: the LASTDRIVE=K command is because I use the SUBST command to identify certain directories as virtual drives in this configuration. Happy with your CONFIG.SYS file? OK, save it and then verify it's ok by testing on your 'scratch diskette', then when you're finally satisfied save it, and go on to the AUTOEXEC.BAT file.

III. Autoexec.Bat file creation Now the system will boot up to a selected configuration. However, you may want to have a certain program start once a configuration is set. You must write your AUTOEXEC.BAT file to select the proper commands to run the progam based upon what configuration you selected. Fortunately, the batch command GOTO allows this to be done easily. Using the new environment variable %config%, the AUTOEXEC.BAT looks into the operating configuration and then selects the correct commands to run. A. Procedure for creating AUTOEX.BAT file. 1. Decide options you want. Again, look at what commands you need to run, once each of the configurations created in the CONFIG.SYS file is selected. a. Commands common to all choices. (run these before your menu choices) b. Windows start up c. Game choice d. Comms program (Any Telecommunications software program) (CompuServe, TE Works, for example) e. Files copied to Ram Drive (Some users place frequently used programs on a Ram Drive to speed up access time.) f. Commands needed (set prompt for example) (Set Environment commands are the most obvious) Each of the above optional choices creates a block in the AUTOEXEC.BAT file that must agree in syntax to the environment variable %menuitem% created in the CONFIG.SYS choice selection. 2. Create menu items on paper. This sets the sequence you want followed in each choice. NOTE: The title of the choice 'MUST' match the title of the configuration block in the CONFIG.SYS file that it is used with. (see example) When you copy them to your AUTOEXEC.BAT file, each section must be separated from the others by a blank line. 3. Test you selections. Using the same process you used to test your configuration blocks in the CONFIG.SYS file, test the blocks to insure they operate correctly before assembling the final AUTOEXEC.BAT file. 4. Assemble your AUTOEXEC.BAT file Once you have verified the blocks work and have placed them

in the order you want. Use your ASCII word processor or DOS's EDIT to create your AUTOEXEC.BAT file. Remember: a. That the line "goto %config%" must be included before the start of the menu choices so the batch file will look into the environment to see which choice to select. b. Each title must agree with a configuration block title ie: :Normal, :Home, :Game, :Comms for example. Otherwise it will not run. c. Each choice must be separated by a blank line and must include the command "goto end" as the last line of each section. This allows the batch file to automatically end once all the commands are run by the selected menuitem. d. The last line in the AUTOEXEC.BAT file must be ":End", or the batch file will not stop automatically. Included examples: Fig 1.1 and 1.2 are CONFIG.SYS and AUTOEXEC.BAT files for a TANDY 1400 dual 3 1/2" floppy drive laptop, with an external 5 1/4" floppy drive. Since my Tandy does not allow the CompuServe pgms and an external drive to co-exist due to memory limitations and the fact that the external floppy is not present when traveling, or when running certain games, I developed the configurations shown to select the configuration I need at different times. Hey, it's an old computer, it works and is paid for, what more do you want? The basic information will work even on a Pentium class multi $ special, as long as you have DOS 6.2 loaded. The only commands that were touched on are the menu items for the CONFIG.SYS file, and certain commands required in the AUTOEXEC.BAT file, you should be familiar with all other commands by now. For clarity each line of the CONFIG.SYS and AUTOEXEC.BAT is numbered and these numbers should be not be used in actual files. Notes about each line are separated by "+ +" and should not be included in your files. 1. Menu choices made: A. On all selections common items required: load SETVERS, MOUSE and ANSI drivers B. Home configuration items: Ram Drive C: load various DOS files into Ram Drive root directory and certain batch and small .EXE and .COM files into a subdirectory on the ram drive external Drive D: defines the external disk drive as drive D: the configuration block will load the device driver and identify the drive as the D: drive

C. GAME1 configuration: no ram drive make external floppy drive C: D. GAME2 configuration: no ram drive no external floppy drive E. COMMS configuration: no ram drive no external floppy drive maximum memory to run large pgme files such as CompuServe NOTE: This is a slightly different configuration than GAME2. F. Road configuration: ram drive as C: drive load various DOS files into Ram Drive root directory and certain batch and small .EXE and .COM files into a subdirectory on the ram drive Fig 1.1 CONFIG.SYS -----------------------------------------------------------------1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. [menu] +tells systems configuration is menu format+ menuitem=Common +menu selection title and title on screen+ menuitem=Normal, Ram Drive=C, B/P Drive=D Home +menu selection+ menuitem=Game1, No Ram Drive, B/P Drive=C Home +menu selection+ menuitem=Game2, No Ram Drive, No B/P Drive Home/Road +menu selection+ menuitem=Comms, Compuserve No B/P drive, No Ram Home/Road +menu selection+ menuitem=Road1, Ram Drive=C, No B/P drive Road +menu selection+ menucolor=15,1 +sets color of menu: white text on blue background+ menudefault=Normal, 30 +tells system default selection and time delay+ +blank line separator+ [Common] +menu selection title+ +title must be same as title above+ device=A:\DOS\Setver.exe device=A:\DOS\Mouse.sys device=A:\DOS\ansi.sys [Normal] +menu selection title+ device=A:\DOS\Ramdrive.sys 128 device=A:\DOS\Backpack.sys files=40 buffers=20 lastdrive=k [Game1] +menu selection title+ device=A:\DOS\Backpack.sys files=20 buffers=10 lastdrive=c [Game2] +menu selection title+

30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43.

files=20 buffers=10 lastdrive=c [Comms] files=40 buffers=20 lastdrive=c +menu selection title+

[Road1] +menu selection title+ device=A:\DOS\Ramdrive.sys 128 files=20 buffers=10 lastdrive=c

-----------------------------------------------------------------Fig 1.2 AUTOEXEC.BAT file: Note: the various commands such as SECRET.COM are peculiar to my files and should not be used if you decide to copy this example. If you leave them in the batch file you'll get ERROR messages such as: "File not found", "File not copied" or other such ERROR messages if you run the AUTOEXEC.BAT file as written below. ----------------------------------------------------------------1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. @a:\bin\secret.com + runs pgme without showing title on screen+ cls pause @type a:\backup\gund.txt +types text on screen without title+ pause cls prompt=$P$G goto %config% +tells system to select setion with the same name as+ +the selected item in the CONFIG.SYS file+ + blank separator line+ :Normal +Normal config selection autoexec commands+ cd a:\backup @autox +batch command to load files to Ram drive C:+ cd\ c: goto end +tells system to skip rest of choices ang end program+ :Game1 goto end :Game2 goto end +Game1 config selection autoexec commands+ +Game2 config selection autoexec commands+

:Comms +Comms config selection autoexec commands+ prompt=COMMS$P$G +reminds that the Comms config is selected+ goto end :Road1 +Road config selection autoexec commands+ cd a:\backup @autox cd\ c: goto end

34. :end

+batch file end command+

----------------------------------------------------------------NOTE: To those who would like to use multiple configurations, and haven't upgraded to MS-DOS 6.x, You can operate by creating several difffernt CONFIG.SYS and AUTOEXEC.BAT files with different titles and creating a batch file to copy a selected configuration to the CONFIG.SYS and AUTOEXEC.BAT files that will operate the next time you reboot. For example using the choices above: Normal: Ramdrive & External drive= CON1.txt & Auto1.txt Games1: External drive= CON2.txt & Auto2.txt Comms: No Ram Drive, External Drive= CON3.txt & Auto3.txt Your menu choices are: 1. Normal 2. Games1 3. Comms The choices as selected will copy: 1: CON1.txt to CONFIG.SYS, Auto1.txt to AUTOEXEC.BAT 2: CON2.txt to CONFIG.SYS, Auto2.txt to AUTOEXEC.BAT 3: CON3.txt to CONFIG.SYS, Auto3.txt to AUTOEXEC.BAT When you 'reboot' the computer starts in the configuration you selected. ------------------------------------------------------------------------------Comments: Any comments, flak, or suggested improvements to this help text can be sent to me, I may or may not answer them personally, but will consider them for inclusion in later versions of this file. Richad H Brown