Ci-dessous, les différences entre deux révisions de la page.
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 frater | back2root: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 '' | This is a simple '' | ||
- | < | + | < |
[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 '' | This is a simple '' | ||
- | < | + | < |
@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. | ||
- | | + | <code batch> |
- | MENUITEM=DOS, | + | [MENU] |
- | MENUITEM=WIN, | + | MENUITEM=DOS, |
+ | MENUITEM=WIN, | ||
- | | + | REM By using SUBMENU you will creating an extra menu(TEST) |
- | SUBMENU=TEST, | + | SUBMENU=TEST, |
- | | + | 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, |
- | MENUDEFAULT=WIN, | + | |
- | | + | REM Here is the SUBMENU it can also include other SUBMENUs |
- | [TEST] | + | [TEST] |
- | MENUITEM=TEST1, | + | MENUITEM=TEST1, |
+ | </ | ||
To read more about multi-configurations menus execute the following command: | To read more about multi-configurations menus execute the following command: | ||
- | | + | <cli dos> |
+ | C: | ||
+ | </ | ||
+ | ===== Commands for Defining Multiple Configurations ===== | ||
+ | |||
+ | A single CONFIG.SYS file can define several different system configurations. | ||
+ | |||
+ | To define multiple configurations, | ||
+ | |||
+ | * [[back2root: | ||
+ | * [[back2root: | ||
+ | * [[back2root: | ||
+ | * [[back2root: | ||
+ | * [[back2root: | ||
+ | |||
+ | To define multiple configurations, | ||
+ | |||
+ | - Define a startup menu in the '' | ||
+ | - Create a configuration block in the '' | ||
+ | - (Optional) In the '' | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | |||
+ | ==== INCLUDE ==== | ||
+ | |||
+ | Includes the contents of one configuration block within another. You can use this command only in your '' | ||
+ | |||
+ | The //INCLUDE// command is one of six special '' | ||
+ | |||
+ | === Syntax === | ||
+ | |||
+ | <code config> | ||
+ | INCLUDE=blockname | ||
+ | </ | ||
+ | |||
+ | === Parameter === | ||
+ | |||
+ | // | ||
+ | |||
+ | === 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 < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | ==== MENUCOLOR ==== | ||
+ | |||
+ | Sets the text and background colors for the startup menu. You can use this command only within a menu block in your '' | ||
+ | |||
+ | The startup menu is a list of choices that appears when you start your computer. You define a startup menu by using special '' | ||
+ | |||
+ | Each item on the menu corresponds to a set of CONFIG.SYS commands called a " | ||
+ | === Syntax === | ||
+ | |||
+ | <code config> | ||
+ | MENUCOLOR=cx[, | ||
+ | </ | ||
+ | |||
+ | === 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" | ||
+ | |||
+ | **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" | ||
+ | |||
+ | 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 | ||
+ | | 1 |Blue | 9 |Bright blue | | ||
+ | | 2 |Green | ||
+ | | 3 |Cyan | | ||
+ | | 4 |Red | ||
+ | | 5 |Magenta | ||
+ | | 6 |Brown | ||
+ | | 7 |White | ||
+ | |||
+ | <WRAP center round info> | ||
+ | On some displays, colors 8 through 15 blink. | ||
+ | </ | ||
+ | |||
+ | === Related Commands === | ||
+ | |||
+ | The // | ||
+ | |||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | |||
+ | ==== 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 '' | ||
+ | |||
+ | The startup menu is a list of choices that appears when you start your computer. You define a startup menu by using special '' | ||
+ | |||
+ | Each item on the menu corresponds to a set of '' | ||
+ | |||
+ | === Syntax === | ||
+ | |||
+ | <code ini> | ||
+ | MENUDEFAULT=blockname[, | ||
+ | </ | ||
+ | |||
+ | === 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" | ||
+ | |||
+ | **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 '' | ||
+ | |||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | ==== MENUITEM ==== | ||
+ | |||
+ | Defines an item on the startup menu. You can use this command only within a menu block in your '' | ||
+ | |||
+ | The startup menu is a list of choices that appears when you start your computer. You define a startup menu by using special '' | ||
+ | |||
+ | === Syntax === | ||
+ | |||
+ | <code ini> | ||
+ | MENUITEM=blockname[, | ||
+ | </ | ||
+ | |||
+ | === Parameters === | ||
+ | |||
+ | **blockname** : Specifies the name of the associated configuration block. The block must be defined elsewhere in the '' | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | ==== 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 '' | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | === Syntax === | ||
+ | |||
+ | <code ini> | ||
+ | SUBMENU=blockname[, | ||
+ | </ | ||
+ | |||
+ | === 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 " | ||
+ | |||
+ | **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 '' | ||
+ | |||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | * The < | ||
+ | ==== 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: | ||
+ | |||
+ | [Steve] | ||
+ | files=20 | ||
+ | device=c: | ||
+ | |||
+ | [Lisa] | ||
+ | files=40 | ||
+ | device=c: | ||
+ | |||
+ | [Common] | ||
+ | </ | ||
+ | |||
+ | This '' | ||
+ | |||
+ | 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 < | ||
+ | |||
+ | 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: | ||
+ | set temp=c: | ||
+ | c:\dos\msav | ||
+ | |||
+ | ; Go to the section that matches the current | ||
+ | ; value of the CONFIG variable | ||
+ | goto %config% | ||
+ | |||
+ | :Steve | ||
+ | path=c: | ||
+ | c: | ||
+ | deskpub | ||
+ | ; now skip Lisa's section & go to end | ||
+ | goto end | ||
+ | |||
+ | :Lisa | ||
+ | path=c: | ||
+ | doskey | ||
+ | net logon lisa | ||
+ | goto end | ||
+ | |||
+ | :end | ||
+ | </ | ||
+ | |||
+ | 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 " | ||
+ | |||
+ | If the current configuration is " |