Sideway
output.to from Sideway
Draft for Information Only

Content

MS DOS Command: Multiple Configurating Cmds
 Description
 Examples

MS DOS Command: Multiple Configurating Cmds

Reference from Microsoft MS-DOS cmd help

Description

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:

Include

Menucolor

Menudefault

Menuitem

Submenu

To define multiple configurations, follow these general steps:

  1. 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.
  2. 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.
  3. (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.

For more information about defining multiple configurations, see the chapter "Configuring Your System" in the MS-DOS User's Guide.

Examples

Defining multiple configurations in your CONFIG.SYS file

The following CONFIG.SYS file defines two configurations:

  • [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]

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.

  • 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

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.


©sideway

ID: 110700229 Last Updated: 7/29/2011 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Travel 18

Reference 79

Computer

Hardware 254

Software

Application 213

Digitization 37

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 431

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2025 Sideway . All rights reserved Disclaimers last modified on 06 September 2019