Outils pour utilisateurs

Outils du site


back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config [2024/08/15 23:58] – créée fraterback2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config [2024/08/28 13:59] (Version actuelle) – [Commands for Defining Multiple Configurations] frater
Ligne 9: Ligne 9:
 This is a simple ''config.sys'', which tries to outline the basics of multiple configurations with the use of MENU and MENUITEM: This is a simple ''config.sys'', which tries to outline the basics of multiple configurations with the use of MENU and MENUITEM:
  
-<code config>+<code batch>
 [MENU] [MENU]
 REM Define an item in the menu, first identifier and then what is written in the menu REM Define an item in the menu, first identifier and then what is written in the menu
Ligne 31: Ligne 31:
 This is a simple ''autoexec.bat'', where the //MENUITEM// is translated into the environement variable //CONFIG//: This is a simple ''autoexec.bat'', where the //MENUITEM// is translated into the environement variable //CONFIG//:
  
-<code bash>+<code batch>
 @ECHO OFF @ECHO OFF
 PROMPT=$P$G PROMPT=$P$G
Ligne 60: Ligne 60:
 It is possible to extend menu-system in the config.sys with SUBMENU, which enables sub-menus. One can also use MENUDEFAULT to specify the default menu item and how long it should wait before it picks the default. It is possible to extend menu-system in the config.sys with SUBMENU, which enables sub-menus. One can also use MENUDEFAULT to specify the default menu item and how long it should wait before it picks the default.
  
-    [MENU] +<code batch> 
-    MENUITEM=DOS, DOS with CD-ROM +[MENU] 
-    MENUITEM=WIN, Windows+MENUITEM=DOS, DOS with CD-ROM 
 +MENUITEM=WIN, Windows
  
-    REM By using SUBMENU you will creating an extra menu(TEST) +REM By using SUBMENU you will creating an extra menu(TEST) 
-    SUBMENU=TEST, Testing+SUBMENU=TEST, Testing
  
-    REM Using MENUDEAFAULT makes it possible to choose a certain +REM Using MENUDEAFAULT makes it possible to choose a certain item(WIN) and if it’s set also select that item after a certain 
-    REM item(WIN) and if it’s set also select that item after a certain +REM time(20 secs) 
-    REM time(20 secs) +MENUDEFAULT=WIN, 20
-    MENUDEFAULT=WIN, 20+
  
-    REM Here is the SUBMENU it can also include other SUBMENUs +REM Here is the SUBMENU it can also include other SUBMENUs 
-    [TEST] +[TEST] 
-    MENUITEM=TEST1, Testing 1+MENUITEM=TEST1, Testing 1 
 +</code>
  
 To read more about multi-configurations menus execute the following command: To read more about multi-configurations menus execute the following command:
  
-    help multi-config+<cli dos> 
 +C:\> help multi-config 
 +</cli>
  
 +===== Commands for Defining Multiple Configurations =====
 + 
 +A single CONFIG.SYS file can define several different system configurations.
 +
 +To define multiple configurations, you use the following special CONFIG.SYS commands:
 + 
 +  * [[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#include|Include]]
 +  * [[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menucolor|Menucolor]]
 +  * [[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menudefault|Menudefault]]
 +  * [[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menuitem|Menuitem]]
 +  * [[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#submenu|Submenu]]
 + 
 +To define multiple configurations, follow these general steps:
 +
 +  - Define a startup menu in the ''CONFIG.SYS'' file by using a **[menu]** header followed by one or more **MENUITEM** commands. The **MENUDEFAULT**, **MENUCOLOR** and **SUBMENU** commands can be used to define special characteristics of the startup menu.
 +  - Create a configuration block in the ''CONFIG.SYS'' file for each configuration you want. A configuration block begins with a block header ((a name surrounded by square brackets)). To each block, add the    __CONFIG.SYS commands__ that you want MS-DOS to carry out when that configuration is selected from the startup menu.
 +  - (Optional) In the ''AUTOEXEC.BAT'' file, use __batch commands__ such as **GOTO** and **IF** to have MS-DOS carry out different ''AUTOEXEC.BAT'' commands depending on the startup configuration.
 + 
 +When a configuration is selected from the startup menu, MS-DOS defines an environment variable named **CONFIG** and sets it to the name of the selected configuration block. To have MS-DOS carry out different sets of commands for different CONFIG values, add a ''GOTO %CONFIG%'' command to your ''AUTOEXEC.BAT'' file.
 + 
 + 
 +==== INCLUDE ====
 +
 +Includes the contents of one configuration block within another. You can use this command only in your ''CONFIG.SYS'' file.
 + 
 +The //INCLUDE// command is one of six special ''CONFIG.SYS'' commands used for defining multiple configurations within a single ''CONFIG.SYS'' file. With multiple configurations, you define a menu that appears when your computer starts. Each menu item corresponds to a block of commands, or "configuration block," in your ''CONFIG.SYS'' file. For more information about multiple configurations and configuration blocks, see the chapter "Configuring Your System" in the MS-DOS User's Guide.
 + 
 +=== Syntax ===
 + 
 +<code config>
 +INCLUDE=blockname
 +</code>
 +
 +=== Parameter ===
 +
 +//blockname// Specifies the name of the configuration block to include.
 + 
 +=== Related Commands ===
 +
 +The INCLUDE command is one of six special CONFIG.SYS commands for defining multiple configurations. The other commands are for defining the startup menu, and are as follows:
 + 
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menuitem|MENUITEM]]> command, which defines an item on the menu.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menudefault|MENUDEFAULT]]> command, which specifies the default menu item.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menucolor|MENUCOLOR]]> command, which defines the color of the menu's text and screen background.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#submenu|SUBMENU]]> command, which defines a submenu.
 +  * The <NUMLOCK> command, which specifies the state of the NUM LOCK key when the startup menu appears. (Although NUMLOCK can be used anywhere in the CONFIG.SYS file, it is especially useful when defining a startup menu.) 
 +==== MENUCOLOR ====
 +
 +Sets the text and background colors for the startup menu. You can use this command only within a menu block in your ''CONFIG.SYS'' file.
 + 
 +The startup menu is a list of choices that appears when you start your computer. You define a startup menu by using special ''CONFIG.SYS'' commands. 
 +
 +Each item on the menu corresponds to a set of CONFIG.SYS commands called a "configuration block." A startup menu makes it possible to start your computer with a variety of configurations. 
 +=== Syntax ===
 +
 +<code config>
 +MENUCOLOR=cx[,cy]
 +</code>
 + 
 +=== Parameters ===
 + 
 +**cx** : Specifies the color of the menu text. You can specify a value from 0 to 15; For a list of values and colors, see "Color Values" later in this topic.
 + 
 +**cy** : Specifies the color of the screen background. You can specify a value from 0 to 15; For a list of values and colors, see "Color Values" later in this topic. The y value is optional; if you do not specify a value, MS-DOS displays the specified text color on a black background.
 + 
 +Be sure to specify different values for x and y, or the text will not be readable.
 + 
 +=== Color Values ===
 + 
 +Valid color values are from 0 to 15, as follows:
 +
 +|  0  |Black            8  |Gray                      |
 +|  1  |Blue        |      9  |Bright blue               |
 +|  2  |Green           10  |Bright green              |
 +|  3  |Cyan        |     11  |Bright cyan               |
 +|  4  |Red             12  |Bright red                |
 +|  5  |Magenta         13  |Bright magenta            |
 +|  6  |Brown           14  |Yellow                    |
 +|  7  |White           15  |Bright white              |
 +
 +<WRAP center round info>
 +On some displays, colors 8 through 15 blink.
 +</WRAP>
 + 
 +=== Related Commands ===
 + 
 +The //MENUCOLOR// command is one of six special ''CONFIG.SYS'' commands for defining startup menus and multiple configurations. The other commands are as follows:
 + 
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#include|INCLUDE]]> command, which includes the contents of one configuration block in another. This command cannot be included in a menu block.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menuitem|MENUITEM]]> command, which defines an item on the menu.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menudefault|MENUDEFAULT]]> command, which specifies the default menu item.
 +  * The <NUMLOCK> command, which specifies the state of the NUM LOCK key when the startup menu appears. (Although NUMLOCK can be used anywhere in the ''CONFIG.SYS'' file, it is especially useful when defining a startup menu.)
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#submenu|SUBMENU]]> command, which defines a submenu.
 +
 +==== MENUDEFAULT ====
 + 
 +Specifies the default menu item on the startup menu and sets a timeout value if desired. You can use this command only within a menu block in your ''CONFIG.SYS'' file. If you do not use this command, MS-DOS sets the default to item 1.
 + 
 +The startup menu is a list of choices that appears when you start your computer. You define a startup menu by using special ''CONFIG.SYS'' commands.
 +
 +Each item on the menu corresponds to a set of ''CONFIG.SYS'' commands called a "configuration block." A startup menu makes it possible to start your computer with a variety of configurations.
 + 
 +=== Syntax ===
 + 
 +<code ini>
 +MENUDEFAULT=blockname[,timeout]
 +</code>
 + 
 +=== Parameters ===
 + 
 +**blockname** : Specifies the default menu item by its associated configuration block. 
 +The block must be defined elsewhere in the CONFIG.SYS file. When MS-DOS displays the startup menu, the default menu item is highlighted and its number appears after the "Enter a choice" prompt.
 + 
 +**timeout** : Determines how many seconds MS-DOS waits before starting the computer with the default configuration. If you don't specify a timeout value, MS-DOS does not continue until the ENTER key is pressed. You can specify a timeout value from 0 to 90 seconds. A timeout of 0 forces automatic selection of the default, effectively bypassing the menu display.
 + 
 +=== Related Commands ===
 + 
 +The ''MENUDEFAULT'' command is one of six special CONFIG.SYS commands for defining startup menus and multiple configurations. The other commands are as follows:
 + 
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menuitem|MENUITEM]]> command, which defines an item on the menu. 
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menucolor|MENUCOLOR]]> command, which defines the color of the menu's text and screen background.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#submenu|SUBMENU]]> command, which defines a submenu.
 +  * The <NUMLOCK> command, which specifies the state of the NUM LOCK key when the startup menu appears. (Although NUMLOCK can be used anywhere in the ''CONFIG.SYS'' file, it is especially useful when defining a startup menu.)
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#include|INCLUDE]]> command, which includes the contents of one configuration block in another. This command cannot be included in a menu block.
 +==== MENUITEM ====
 + 
 +Defines an item on the startup menu. You can use this command only within a menu block in your ''CONFIG.SYS'' file. You can have up to nine menu items per menu.
 + 
 +The startup menu is a list of choices that appears when you start your computer. You define a startup menu by using special ''CONFIG.SYS'' commands. Each item on the menu corresponds to a set of CONFIG.SYS commands called a "configuration block." A startup menu makes it possible to start your computer with a variety of configurations.
 + 
 +=== Syntax ===
 + 
 +<code ini>
 +MENUITEM=blockname[,menu_text]
 +</code>
 + 
 +=== Parameters ===
 + 
 +**blockname** : Specifies the name of the associated configuration block. The block must be defined elsewhere in the ''CONFIG.SYS'' file. If the menu item is selected from the startup menu, MS-DOS carries out the commands in the associated configuration block, as well as any commands at the beginning of the CONFIG.SYS file and any commands in configuration blocks with the [common] header.
 +
 +If MS-DOS cannot find a block with the specified name, the item does not appear on the startup menu. The block name can be up to 70 characters long and can contain most printable characters. It cannot include spaces, backslashes ( \ ), forward slashes ( / ), commas, semicolons ( ; ), equal signs ( = ), or square brackets ([ and ]).
 + 
 +**menu_text** : Specifies the text you want MS-DOS to display for this menu item. If you don't specify any menu text, MS-DOS displays the block name as the menu item. The menu text can be up to 70 characters long and can contain any characters you want.
 + 
 +=== Related Commands ===
 +
 +The ''MENUITEM'' command is one of six special CONFIG.SYS commands for defining startup menus and multiple configurations. The other menu-definition commands are:
 + 
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menudefault|MENUDEFAULT]]> command, which specifies the default menu item.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menucolor|MENUCOLOR]]> command, which defines the color of the menu's text and screen background.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#submenu|SUBMENU]]> command, which defines a submenu.
 +  * The <NUMLOCK> command, which specifies the state of the NUM LOCK key when the startup menu appears. (Although NUMLOCK can be used anywhere in the ''CONFIG.SYS'' file, it is especially useful when defining a startup menu.)
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#include|INCLUDE]]> command, which includes the contents of one configuration block in another. This command cannot be included in a menu block. 
 +==== SUBMENU ====
 + 
 +Defines an item on a startup menu that, when selected, displays another set of choices. You can use this command only within a menu block in your ''CONFIG.SYS'' file.
 + 
 +The startup menu is a list of choices that appears when you start your computer. You define a startup menu by using special CONFIG.SYS commands. 
 +
 +Each item on the menu corresponds to a set of ''CONFIG.SYS'' commands called a "configuration block." A startup menu makes it possible to start your computer with a variety of configurations.
 + 
 +=== Syntax ===
 +
 +<code ini>
 +SUBMENU=blockname[,menu_text]
 +</code>
 + 
 +=== Parameters ===
 +
 +**blockname** : Specifies the name of the associated menu block. The menu block must be defined elsewhere in the CONFIG.SYS file and can contain menu-definition commands. Unlike the "main" menu block, which must have the block name [MENU], a menu block for a submenu can have any name you want. If MS-DOS cannot find a block with the specified name, the item does not appear on the startup menu. The block name can be up to 70 characters long and can contain most printable characters. It cannot include spaces, backslashes ( \ ) and forward slashes ( / ), commas, semicolons ( ; ), equal signs ( = ), and square brackets ([ and ]).
 + 
 +**menu_text** : Specifies the text you want MS-DOS to display for this menu item. If you don't specify any menu text, MS-DOS displays the block name as the menu item. The menu text can be up to 70 characters long and can contain any characters you want.
 + 
 +=== Related Commands ===
 +
 +The ''SUBMENU'' command is one of six special CONFIG.SYS commands for defining startup menus. The other commands are:
 + 
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menuitem|MENUITEM]]> command, which defines an item on the menu.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menudefault|MENUDEFAULT]]> command, which specifies the default menu item.
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#menucolor|MENUCOLOR]]> command, which defines the color of the menu's text and screen background.
 +  * The <NUMLOCK> command, which specifies the state of the NUM LOCK key when the startup menu appears. (Although NUMLOCK can be used anywhere in the ''CONFIG.SYS'' file, it is especially useful when defining a startup menu.)
 +  * The <[[back2root:ibm-pc-ms-dos:ms-dos:6-22-multi-config#include|INCLUDE]]> command, which includes the contents of one configuration block in another. This command cannot be included in a menu block.
 +==== Multiple Configurations : Examples ====
 + 
 +=== Defining multiple configurations in your CONFIG.SYS file ===
 + 
 +The following CONFIG.SYS file defines two configurations:
 + 
 +<code ini>
 +[Menu]
 +menuitem=Steve
 +menuitem=Lisa
 +
 +[Common]
 +dos=high
 +buffers=15
 +device=c:\dos\himem.sys
 +
 +[Steve]
 +files=20
 +device=c:dos\emm386 2048
 +
 +[Lisa]
 +files=40
 +device=c:\net\network.sys
 +
 +[Common]
 +</code>
 +
 +This ''CONFIG.SYS'' file configures the computer for either Steve or Lisa. For both configurations, MS-DOS carries out the three commands in the first [common] section: //DOS=HIGH, BUFFERS=15, and DEVICE=C:\DOS\HIMEM.SYS//. Steve uses a desktop publishing program that requires expanded memory, so his configuration includes a command for //EMM386//. He does not use the network.
 +
 +Lisa uses the network but not desktop publishing. Her configuration starts the network driver.
 + 
 +=== Defining multiple configurations in your AUTOEXEC.BAT file ===
 + 
 +When a configuration is selected from the startup menu, MS-DOS defines an environment variable named CONFIG and sets it to the name of the selected configuration block. In the AUTOEXEC.BAT file, you can use the <GOTO> command to have MS-DOS carry out different sets of commands for different CONFIG values.
 + 
 +The following AUTOEXEC.BAT file uses the GOTO command with the CONFIG variable to carry out different sets of commands. This AUTOEXEC.BAT file is designed to work with the sample CONFIG.SYS file in the preceding section.
 + 
 +<code batch>
 +c:\dos\smartdrv.exe
 +set temp=c:\temp
 +c:\dos\msav
 +
 +; Go to the section that matches the current
 +; value of the CONFIG variable
 +goto %config%
 +
 +:Steve
 +path=c:\dos;c:\deskpub;c:\typeset
 +c:\mouse\mouse.com
 +deskpub
 +; now skip Lisa's section & go to end
 +goto end
 +
 +:Lisa
 +path=c:\dos;c:\network;c:\utility
 +doskey
 +net logon lisa
 +goto end
 +
 +:end
 +</code>
 + 
 +When MS-DOS runs this AUTOEXEC.BAT file, it starts SMARTDrive, sets the TEMP environment variable, and starts the MS-DOS Anti-Virus program. MS-DOS then goes to the section that matches the value of the CONFIG variable.
 + 
 +If the name of the selected configuration is "Steve," MS-DOS goes to the Steve section. It then sets the search path for Steve, loads the MOUSE.COM program from the C:\MOUSE directory, and runs the desktop publishing program. The GOTO END command instructs MS-DOS to skip to the End section; this prevents the commands in the Lisa section from being carried out for Steve's configuration.
 + 
 +If the current configuration is "Lisa," the search path is set differently, MS-DOS runs the Doskey program, and a Logon command instructs the network driver (loaded from the CONFIG.SYS file) to connect the computer to the network.
back2root/ibm-pc-ms-dos/ms-dos/6-22-multi-config.1723759088.txt.gz · Dernière modification : 2024/08/15 23:58 de frater