home *** CD-ROM | disk | FTP | other *** search
/ Cheet Sheets 1995 April/May / CHEET40.ZIP / 1OPTIP40.TXT < prev    next >
Text File  |  1995-05-07  |  6KB  |  223 lines

  1. ~Today's Top DOS Tip
  2.  
  3. Using multiple configurations on your system  -  By Simon Burrows
  4.  
  5.  
  6.  
  7. ~`Introduction
  8. ~`────────────
  9.  
  10. `Since the  arrival of  more and  more flash games, bigger and more
  11. `powerful spreadsheets,  and more  system-hungry  C.A.D.  programs,
  12. `organising your  system to  give the right memory-configuration to
  13. `run all  these things  can be  an unwanted  hassle. Sometimes  the
  14. `results of  this can  be disastrous,  with a great pile of boot-up
  15. `disks, each of which used to load a different configuration so all
  16. `your different  software will perform.  However, this doesn't have
  17. `to be  the story!   Included  in MS-DOS  6.x, is a feature used to
  18. `have multiple configurations all listed in your two CONFIG.SYS and
  19. `AUTOEXEC.BAT programs.   Each time you power-on your computer, you
  20. `are presented  with  a  menu  from  which  you  can  select  which
  21. `configuration you wish to be used in this session.
  22.  
  23.  
  24. ~`Method and Examples
  25. ~`───────────────────
  26.  
  27. `Of course,  the  first  step  is  to  decide  how  many  different
  28. `configurations you  are going  to want  to use,  and what each one
  29. `will have  in it.  When you have done this, you need to decide two
  30. `names for  each one.   The  first name is a simple reference which
  31. `only your  computer will  use  (such as 'extended' or 'expanded').
  32. `The second is a more detailed name which will be used as the title
  33. `for the memory-configuration on the menu.
  34.  
  35. `For example,  if  you  have  one  configuration  to  load  maximum
  36. `extended memory,  and one  to load  maximum expanded  memory,  you
  37. `might use the following names :-
  38.  
  39.  
  40.  
  41. ~`Simple Name   │   Main name for menu
  42. ~`──────────────│──────────────────────────────────────────────────
  43. ~`EXTENDED      │  Use HIMEM.SYS to enable max. Extended Memory
  44. ~`EXPANDED      │  Use EMM386.EXE to enable max. Expanded Memory
  45.  
  46.  
  47.  
  48. `When you  have decided all this, edit your CONFIG.SYS, and type in
  49. `each of  these configurations,  one at a time, with a two-line gap
  50. `in between  each one.   When that's down on the screen, put a line
  51. `above each  configuration with  the simple  name for the config in
  52. `square brackets.   For  example,  a  two-configuration  CONFIG.SYS
  53. `might look like this :-
  54.  
  55.  
  56.  
  57. ~`[EXTENDED]
  58. `DEVICE=C:\DOS\HIMEM.SYS
  59. `DOS=HIGH,UMB
  60. `BUFFERS=20
  61. `FILES=20
  62.  
  63. ~`[EXPANDED]
  64. `DEVICE=C:\DOS\HIMEM.SYS
  65. `DOS=HIGH
  66. `DEVICE=C:\DOS\EMM386.EXE 1024
  67. `BUFFERS=20
  68. `FILES=30
  69.  
  70.  
  71.  
  72. `Now you  are ready  to add the lines at the top of this CONFIG.SYS
  73. `file to  tell your  PC that you want to have a menu displayed each
  74. `item you  boot-up your  PC.   To do  this, the  first line  of the
  75. `CONFIG.SYS must read '[MENU]'.  After this, you will need one line
  76. `for each  configuration starting  with 'MENUITEM=', then the short
  77. `name for the config, then a comma followed by your main name.
  78.  
  79. `If we  add these  lines to  our example CONFIG.SYS, we now get the
  80. `following :-
  81.  
  82.  
  83.  
  84. ~`[MENU]
  85. `MENUITEM=EXTENDED, Use HIMEM.SYS to enable max. Extended Memory
  86. `MENUITEM=EXPANDED, Use EMM386.EXE to enable max. Expanded Memory
  87.  
  88. ~`[EXTENDED]
  89. `DEVICE=C:\DOS\HIMEM.SYS
  90. `DOS=HIGH,UMB
  91. `BUFFERS=20
  92. `FILES=20
  93.  
  94. ~`[EXPANDED]
  95. `DEVICE=C:\DOS\HIMEM.SYS
  96. `DOS=HIGH
  97. `DEVICE=C:\DOS\EMM386.EXE 1024
  98. `BUFFERS=20
  99. `FILES=30
  100.  
  101.  
  102.  
  103. `Once this  is down,  it could  be argued  that you  have  finished
  104. `editing this  file.   However, what happens if you have some lines
  105. `which appear  in all  these memory configurations?  If this is the
  106. `case, use  an extra  configuration called '[COMMON]' which has all
  107. `these repeated lines in it.  So long as this is called '[COMMON]',
  108. `your computer  will carry out all the lines in here as well as the
  109. `ones in  the specialist  configuration selected  from the  Startup
  110. `Menu.  For example, our CONFIG.SYS may look like this :-
  111.  
  112.  
  113.  
  114. ~`[MENU]
  115. `MENUITEM=EXTENDED, Use HIMEM.SYS to enable max. Extended Memory
  116. `MENUITEM=EXPANDED, Use EMM386.EXE to enable max. Expanded Memory
  117.  
  118. ~`[COMMON]
  119. `DEVICE=C:\DOS\HIMEM.SYS
  120. `BUFFERS=20
  121.  
  122. ~`[EXTENDED]
  123. `DOS=HIGH,UMB
  124. `FILES=20
  125.  
  126. ~`[EXPANDED]
  127. `DOS=HIGH
  128. `DEVICE=C:\DOS\EMM386.EXE 1024
  129. `FILES=30
  130.  
  131.  
  132.  
  133. `That's the  CONFIG.SYS file  finished.   Now we  need to edit your
  134. `AUTOEXEC.BAT file  so this  is split  into all  the configurations
  135. `needed.   To do this, we split the AUTOEXEC.BAT in the same way by
  136. `having different  sections for  different configuration.  However,
  137. `instead of  each one  starting by the name of the configuration in
  138. `square brackets, we instead start the line with a colon.
  139.  
  140. `At the  end of  each section,  we also  need a  line telling  your
  141. `computer to  skip to  the end  of the  file so it doesn't load any
  142. `other lines.  This is done by saying 'GOTO END' at the end of each
  143. `configuration, then  having an  empty section  called 'END' at the
  144. `bottom of  the file.  We also need a line at the start which tells
  145. `your computer  to go to the section selected from your menu.  This
  146. `line reads 'GOTO %CONFIG%'.
  147.  
  148. `All this  put together, the AUTOEXEC.BAT for the CONFIG.SYS above,
  149. `may look as follows :-
  150.  
  151.  
  152.  
  153. `GOTO %CONFIG%
  154.  
  155. ~`:EXTENDED
  156. `C:\DOS\MOUSE.COM
  157. `C:\WINDOWS\SMARTDRV.EXE 1024
  158. `PATH=C:\DOS;C:\;C:\WINDOWS
  159. `PROMPT $P$G
  160. `GOTO END
  161.  
  162. ~`:EXPANDED
  163. `C:\DOS\MOUSE.COM
  164. `PATH=C:\DOS;C:\;C:\WINDOWS
  165. `PROMPT $T$D $P$G
  166. `GOTO END
  167.  
  168. ~`:END
  169.  
  170.  
  171.  
  172. `There's just  one problem,  though!   Instead of  having a section
  173. `called ':COMMON'  to put  in lines  which are  the  same  in  each
  174. `configuration   (like in the CONFIG.SYS file), you need to add the
  175. `lines which  would into  such a section before the 'GOTO %CONFIG%'
  176. `line.  With this included, out AUTOEXEC.BAT file ends thus :-
  177.  
  178.  
  179.  
  180. `PATH=C:\DOS;C:\;C:\WINDOWS
  181. `C:\DOS\MOUSE.COM
  182. `GOTO %CONFIG%
  183.  
  184. ~`:EXTENDED
  185. `C:\WINDOWS\SMARTDRV.EXE 1024
  186. `PROMPT $P$G
  187. `GOTO END
  188.  
  189. ~`:EXPANDED
  190. `PATH=C:\DOS;C:\;C:\WINDOWS
  191. `PROMPT $T$D $P$G
  192. `GOTO END:
  193.  
  194. ~:END
  195.  
  196.  
  197.  
  198. `If you now save these two files  (AUTOEXEC.BAT and CONFIG.SYS) and
  199. `reeboot your  machine, you should find yourself with a nice start-
  200. `up menu looking rather like this :-
  201.  
  202.  
  203.  
  204. ~`MS-DOS 6.x Startup Menu
  205. ~`═══════════════════════
  206.  
  207. ~`1. Extended
  208. ~`2. Expanded
  209.  
  210. ~`Enter a choice:_
  211.  
  212.  
  213.  
  214. Well there it is....   Have a nice day....
  215.  
  216.  
  217.  
  218. `       ─────────────
  219. ~`       Simon Burrows
  220. `       ─────────────
  221.  
  222.  
  223.