home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / SYSTEM / MULTC21E.ZIP / MULTICNF.DOC next >
Encoding:
Text File  |  1991-08-13  |  9.2 KB  |  234 lines

  1. **********************************************************************
  2.       MULTICNF.SYS  v2.1
  3.  multi configuration program
  4. **********************************************************************
  5.   (C) 1990 Tero Pelander.
  6.  
  7.     You can distribute this utility when
  8.     following conditions are met:
  9.      - The program is not modified in any way
  10.      - You ask no contribution from the receiver
  11.         of this program.
  12.  
  13.  
  14.  
  15. *****  Description  *****
  16.  This program enables one to use 3 different CONFIG.SYS and AUTOEXEC.BAT
  17. configurations. These configurations can be selected at boot-time by 
  18. pressing a specific key.
  19.  
  20.  
  21.  
  22. *****  Usage  *****
  23.  The MULTICNF.SYS file should be the first line in the CONFIG.SYS file,
  24. and the CONFIG.SYS file must contain four lines starting with
  25. "device=--------".
  26.  
  27. Usage: device=MULTICNF.SYS xx /T /N /R /Ox
  28.  
  29. Explanations:
  30. xx - wait time in seconds 0 - 60
  31.  - This is the time that program will wait for a responce from the keyboard.
  32.  - If the time is 0 none of the texts (see /T below) are writen on the 
  33.    screen unless one of the selection keys is pressed.
  34.  - The default wait time is 10s.
  35.  - This should be the first option.
  36.  
  37. /T - Text lines follow
  38.  - This option allows the user to display instructions on the screen.
  39.    Any line following that begins with "device=text  " will be displayed.
  40.    Note however that only the text that follows "device=text  " will 
  41.    be displayed, also note the trailing two blanks.
  42.  
  43.    e.g. device = text Press shift key for max available memory
  44.     DEVICE=TEXT  Press alt key for min memory but most tsr programs
  45.         ...
  46.  - Depending on the MS-DOS version you should leave one or two spaces behind
  47.    the word TEXT before you start your own text.
  48.  - Currently all text will be converted to uppercase (by MS-DOS).
  49.  - If wait time is 0 none of the texts will be printed. However, you should 
  50.    still leave the /T option to suppress any warnings about device=text lines.
  51.  
  52. /N - No prompt
  53.  - The line "Press SHIFT, ALT or CTRL." won't be printed
  54.  
  55. /R - Remove comments
  56.  - You may want to include explanations in your config.sys starting with the
  57.    REM command. Ms-dos versions before 4.0 don't understand that command
  58.    and will print "Unrecognized command". Including this option will suppress 
  59.    all "Unrecognized command" warnings but warnings like 
  60.    "Unable to find ANSI.SYS driver" are printed. Note the /O option below.
  61.  
  62. /Ox - Force the ms-dos version
  63.  - The program automaticly detects what MS-DOS version it is using but
  64.    you can force it to use different settings.
  65.  
  66.    Where x=:
  67.      0 or null
  68.        - assume ms-dos 4.0 or greater (the default)
  69.      1
  70.        - assume ms-dos before 3.3 - Note this leaves a small part of code 
  71.          in memory and does not use the empty line mark (see below),
  72.      2
  73.        - assume ms-dos 3.3x - also does not use the empty line mark.
  74.  
  75.    Empty line mark
  76.      - Ms-dos versons before 4.0 do not count lines in config.sys and do
  77.        not have an "empty line" mark. Therefor when multicnf processes
  78.        config.sys it uses the "unrecognized command" mark to revise 
  79.        config.sys in memory for later processing. This will produce
  80.        an "unrecognized command" at the end of config.sys. The /R option
  81.        does not remove this behaviour. NOTE see technical information below
  82.        for more details.
  83.  
  84. Example of the first line in CONFIG.SYS for MS-DOS v3.2:
  85. DEVICE=C:\MULTICNF.SYS 15 /R
  86.  
  87. Example of the first line in CONFIG.SYS for MS-DOS v4.0:
  88. device=c:\multicnf.sys 15
  89.  
  90.  
  91.  
  92. *****  Selecting the boot configuration  *****
  93.  When you boot your machine with MULTICNF, it will print it's acknowledgments,
  94. any text you have specified and asks you to press SHIFT, ALT or CTRL.
  95. One of these keys can already be depressed when the program executes. If none 
  96. of the keys are pressed in a preset time (see xx above), then configuration
  97. one (as if a SHIFT were pressed) is selected. Therefore, the first
  98. configuration is considered to be "the normal one".
  99.  
  100.  
  101.  
  102. *****  Creating multiple configurations  *****
  103.  All three configurations must be in CONFIG.SYS, separated by lines that 
  104. begin with "DEVICE=--------" (8 minuses). The part between the first line 
  105. (which loads MULTICNF) and the first separator (device=--------) is always 
  106. executed. The part from the first separator to second is executed when 
  107. the normal/SHIFT configuration is selected, and so on (see the example below).
  108.  
  109.  You can include comments to the end of separator line by first putting
  110. a space after "device=------".
  111.  
  112.  You can put commands after the last separator line but the results are
  113. a bit messy. Ms-dos versions 2.11 -3.x will give the warning
  114. "Unrecognized command" before the commands after the last "device=--------"
  115. line is executed. Version 4.x users will get invalid line numbers when an
  116. error is detected on such a line, usually around 100 - 500 depending on how
  117. many device=text lines there are.
  118.  
  119.  An example of config.sys (without the actual CONFIG commands.)
  120.  
  121. DEVICE=C:\DOS\DRV\MULTICNF.SYS 15 /T
  122. <if you use option /T, device=text lines are placed here>
  123. <commands in here are always executed>
  124. DEVICE=-------- <comment here>
  125. <commands in here are executed when nothing or SHIFT is pressed>
  126. DEVICE=-------- <comment here>
  127. <commands in here are executed when ALT is pressed>
  128. DEVICE=-------- <comment here>
  129. <commands in here are executed when CTRL is pressed>
  130. DEVICE=-------- <comment here>
  131.  
  132.  
  133.  
  134. *****  Detecting errors in config.sys  *****
  135.  An error will be reported if any line (even within a part that doesn't get
  136. executed) has a command that MS-DOS doesn't understand and you haven't used
  137. the /R option.
  138.  
  139.  MS-DOS version 4.0 always reports the line number with the error. Lines
  140. correspond directly to the config.sys file. However, out of range line numbers 
  141. will result from adding command(s) after the last "device=--------" line.
  142.  
  143.  If you are using the /O1 or /O2 option or you are using ms-dos version 3.3 or
  144. older you will always get an extra "Unrecognized command" warning at the end
  145. of config.sys.
  146.  
  147.  
  148.  
  149. *****  Using multiple AUTOEXEC.BATs  *****
  150.  The MULTICNF.SYS program doesn't change AUTOEXEC.BAT in any way regardless 
  151. of the key pressed when booting. The way you can use multiple AUTOEXECs when
  152. booting, is by using the other program included: MULTIRET.COM. It returns an
  153. ERRORLEVEL depending on the key pressed during boot.
  154. as follows:
  155.  
  156. 0 - no key was pressed at boot time.
  157. 1 - SHIFT was pressed
  158. 2 - ALT was pressed
  159. 3 - CTRL was pressed
  160.  
  161.  The following example shows a way of doing this. The example just 
  162. echoes the key combination the machine was booted with, but of course you 
  163. can put anything you want in place of the echoes.
  164.  
  165. @echo off
  166. rem  @ as the first mark on the line turn echo off for one line only
  167. rem  on MS-DOS version 3.3 and later
  168. multiret
  169. if errorlevel 3 goto CNF3
  170. if errorlevel 2 goto CNF2
  171. if errorlevel 1 goto CNF1
  172. echo No key was pressed
  173. :CNF1
  174. echo Started with config 1, SHIFT/none was pressed
  175. goto END
  176. :CNF2
  177. echo Started with config 2, ALT was pressed
  178. goto END
  179. :CNF3
  180. echo Started with config 3, CTRL was pressed
  181. :END
  182.  
  183.  
  184.  
  185. *****  Technical information *****
  186.  During boot, after MS-DOS has been loaded the CONFIG.SYS file is decoded to 
  187. memory. When a device (e.g. MULTICNF.SYS) is executed for the first time it is 
  188. given a pointer to this decoded information of CONFIG.SYS in memory.
  189.  
  190.  This program makes changes to the information and after it has finished it
  191. tells MS-DOS that it couldn't install itself properly. MS-DOS releases
  192. the memory and executes the next command in this changed information.
  193. MS-DOS versions before 3.3 can't properly dechain the device driver so a
  194. small part (48 bytes) of the program is left in the memory.
  195.  
  196.  There is no way of knowing where the end of the decoded information is so
  197. the user must supply the info by a "device=--------" line. Because of the way
  198. multicnf patches the decoded info this is the place where anomalies get
  199. grouped. On MS-DOS versions 2.11 - 3.x the unwanted lines are writen over
  200. by later config.sys lines and at the end an "unrecognized command" line is
  201. used to fill up the space.
  202.  
  203.  On MS-DOS version 4.0 and later it is possible to use an "empty line" mark.
  204. Every line that is removed is replaced by an "empty line" mark. Because
  205. this is only one byte long the rest of data has to be moved forward.
  206. The end of the decoded config.sys area is filled with "empty line" marks.
  207. This is why line numbers on an error that is after the last "device=--------"
  208. line are totally wrong. Usually the line number can be 50 to 500 too large.
  209.  
  210.  The program has been tested on MS-DOS versions 2.11, 3.2, 3.3 and 4.0.
  211.  
  212.  
  213.  
  214. *****  Version history  *****
  215. 1.0    First releace by Sami Tammilehto
  216. 2.0    completely rewritten by a new author
  217.     added all options, wait time is no longer needed on config.sys,
  218.     added support for ms-dos 4.0
  219. 2.1    fixed a bug: time zero and no key pressed
  220.     dos timer is no longer modified
  221.     commands behind last device=-------- line allowed
  222. (--)    (document rewriten by Ted Medin)
  223.  
  224. I hope you have use of this utility. If you find any bugs, are intrested
  225. in the source code or think of some enchantments contact me.
  226.  
  227. Internet: tpelander@kontu.utu.fi      (130.232.2.1)
  228. Bitnet:   tpelander@FIRIEN
  229. Post:    Tero Pelander
  230.     TOP-keskus
  231.     Torninkatu
  232.     20100 Turku
  233.     Finland
  234.