Best use of the CONFIG.SYS file

When the computer is turned on, its built-in programs perform internal diagnostics and load a part of DOS, which then looks for a file named CONFIG.SYS in the root directory of the boot disk. If the file is found, it is used to configure the system and download the full version of DOS, if not (perhaps because you accidentally destroyed it, the computer loads DOS in the default configuration and does not install any additional drivers. The same will happen if you give DOS the instruction to ignore CONFIG.SYS (see "Boot Modes").

Before trying to improve anything, you need to take precautions - create a backup boot disk. Whenever you change a configuration file or run a custom installation program, you risk making it impossible to boot from the hard disk. If this happens, the boot diskette will help you restart the system.

Take a clean floppy disk and format it with the FORMAT A: / S command (ie copying the DOS system files). Then check if there is a COMMAND.COM file on the floppy disk, and try to boot from it. After making sure that the download is normal, mark the floppy disk as "System". Now you can start.

Modes of initial loading.

In MS-DOS 6.x, a number of new functions have been introduced to avoid inconvenience when configuring the CONFIG.SYS file. When the message "MS-DOS starts:" appears on the screen (Now starting MS-DOS :) , You can bypassing the <F5> key to disable the config.sys file, after which DOS boots in the standard configuration. This is useful to you if in config.sys there is an error preventing the system from booting. Although there is a boot diskette, this way you can solve many problems associated with the download. Pressing <F8>, you run config.sys (and in DOS 6.2 also autoexec.bat) in a step-by-step mode, where you can select, execute or ignore for each line, and after passing the lines you are interested in, issue a command to execute or skip all remaining ones. If you want to know which line is causing the error, then downloading from <F8>, just confirm the execution of all the rows in a row until an error occurs. The REM command and the semicolon are convenient when you need to provide a config.sys with a comment explaining, for example, why such a line is added or the following parameter is changed:

REM Old setting:
REM BUFFERS = 10
REM XYZ-Calc requires more:
BUFFERS = 20

But more often they serve to temporarily turn off the line while working out different versions of the file. It's much easier to type "REM" before the beginning of a line than to delete it, and then, if you need to restore the old version, dial again.

And finally, in MS-DOS 6.x, it became possible to create colorful configuration menus and set the default settings for the case when nobody is present when downloading - they will be used if after a certain time the choice does not occur.

Configuration commands.

[COMMON] - Specifies the config.sys command block that is executed in all selections.
INCLUDE - allows you to include one menu block in another and avoid thus repeating blocks.
MENUCOLOR - defines the color of the text and background of the menu.
MENUDEFAULT - specifies the default menu item and sets the waiting time.
MENUITEM - sets the menu item for the internal name and text displayed on the screen.
SUBMENU - allows you to create submenus for a specific menu item.

When you select the menu item config.sys, its name is passed to the autoexec.bat file via an environment variable called CONFIG. If, for example, there were two items in the menu - DOS and WINDOWS, the file autoexec.bat can be started with the command GOTO% CONFIG%, which will cause a transition to one of two labels: DOS or: WINDOWS.

The config.sys file with a multivariate setting looks like this:

REM Example of the CONFIG.SYS file

[MENU]
NUMLOCK = OFF
MENUCOLOR = 1.15
MENUDEFAULT = DOS, 60
MENUITEM = DOS, DOS Configuration
MENUITEM = WIN, Windows Configuration

[DOS]
There must be DOS configuration commands

[WIN]
There should be Windows configuration commands

[COMMON]
There should be commands common to DOS and Windows

The corresponding autoexec.bat file should look like this:

REM There should be commands common to DOS and Windows
GOTO% CONFIG%

: DOS
REM There must be DOS configuration commands
GOTO DONE

: WIN
REM There should be Windows configuration commands

: DONE
REM There should be a final, common for DOS and Windows

The execution of the config.sys file given above starts with the <Num Lock> key being turned off and the blue letters are set on the white background of the screen. As an option, DOS is selected by default, the wait time is set to 60 seconds. On the screen, menu items look like:

  1. DOS Configuration
  2. Windows Configuration

Their internal names are DOS and WIN. The file consists of four sections. You can create a fifth (or, more accurately, zero) by placing any commands above the [MENU] line - they will be executed before the menu appears on the screen.

Best of all, demonstrate the available config.sys and autoexec.bat files:

Rem Example of a CONFIG.SYS file

[Menu]
NUMLOCK = ON
Menucolor = 9.0
Menudefault = DOS, 60
Menuitem = DOS, DOS ...
Menuitem = WIN, Windows95 ...

[DOS]
DEVICE = C: \ WINDOWS \ HIMEM.SYS / shadow: on
DEVICE = C: \ WINDOWS \ EMM386.EXE
DEVICEHIGH = C: \ DN \ ANSI.SYS
DOS = HIGH, UMB, AUTO

REM Description of the CD-ROM drive (bottom line)
DEVICEHIGH /L:1=\CPQDOS\CPQIDECD.SYS / D: IDECD001

FILESHIGH = 80
BUFFERSHIGH = 40.4
FCBSHIGH = 10
SWITCHES = / F

[WIN]
Device = C: \ WINDOWS \ HIMEM.SYS / shadow: on

[COMMON]
Device = c: \ windows \ COMMAND \ display.sys con = (ega ,, 1)
Country = 007,866, c: \ windows \ COMMAND \ country.sys
Device = c: \ windows \ cs4232c.exe / A

Rem Sample AUTOEXEC.BAT file

@SET DN = C: \ DN \
@PATH c: \ windows; c: \ windows \ COMMAND; C: \ DN
@SET TEMP = C: \ DN
@ECHO OFF
SET BLASTER = A220 I5 D1 T4
GOTO% config%

: DOS
Rem Description of the CD-ROM drive (bottom two lines)
SET FIXP = E:
LH \ CPQDOS \ MSCDEX.EXE / D: IDECD001 / L: E
LH C: \ WINDOWS \ COMMAND \ DOSKEY

C: \ MOUSE \ MOUSE.COM / L = GB
LH MKEY.COM
C: \ DN \ DN.COM
GOTO DONE

: WIN
LH MKEY.COM
GOTO DONE

: DONE
PATH = C: \ WINDOWS; C: \ WINDOWS \ COMMAND;% PATH%
Mode con codepage prepare = ((866) c: \ windows \ COMMAND \ ega3.cpi)
Mode con codepage select = 866

Config.sis Commands

This description applies to MS-DOS 6.x, so if you have an earlier version, please check the supplied manual to see which commands are available to you !!!

The following commands can only be used in Config.sys:

BUFFERS = m [, n] - sets the number of available DOS primary (m) and secondary (n) buffers. When Config.sys contains the DOS = HIGH command, buffers are loaded into the HMA. If you are using a disk caching program (for example - SmartDrive), set a small number of primary buffers and do not use secondary ones. The default value of m depends on the amount of memory and capacity of the hard drives of the computer (n is zero by default).

COUNTRY = xxx [, yyy] [, <file name>] - instructs DOS to use a character set, as well as time output formats, dates adopted in a particular country. (Xxx is the three-digit country code [the same as the phone code], yyy is the number of the corresponding code page [character set], <filename> is the name of the file containing the country information [by default Country.sys]).

DEVICE = <filename> - loads the device driver into the regular memory and initializes it.

DEVICEHIGH = [/ L [/ S]] <file name> - loads the device driver in the upper memory (UMB) and initializes it. If the driver does not fit into the UMB, the command acts in the same way as the DEVICE = command. The / L and / S switches help optimize memory.

DOS = [HIGH | LOW] [UMB | NOUMB] - determines whether DOS needs to load part of its code into HMA (YES - HIGH, NO - LOW) and keep in touch with the upper memory (YES - UMB, NO - NOUMB).

DRIVPARM - sets the parameters of the drive or other similar device.

FCBS = n - sets the number of file management blocks that can be opened at the same time. Usually n is from 1 to 255. The default is 4.

FILES = n - sets the number of files that can be opened at the same time.

INSTALL = <filename> - loads the resident program when Config.sys is executed. These commands are processed after the DEVICE commands are executed, and before loading Command.com.

LASTDRIVE = X - sets the maximum allowed letter of the device. Typically, by default, the logical device with the maximum number is the one following the one that last found or created DOS when the computer was booted.

NUMLOCK = [ON | OFF] - turns the <Num Lock> key on or off. This command is useful when you want to control the cursor with the numeric keypad.

SHELL = <file name> [parameters] - specifies the command interpreter (usually COMMAND.COM) and the path to it. Using parameters, you can specify a start file other than Autoexec.bat

Further commands can be used in CONFIG.SYS and AUTOEXEC.BAT and in the DOS command line:

BREAK = [ON | OFF] - when BREAK = ON, pressing "<Ctrl> + C" and "<Ctrl> + <Break>" occurs more often than usual. The default setting is BREAK = OFF. When using this command in AUTOEXEC.BAT and the DOS command line, the equal sign must be omitted.

REM - indicates that the string is a comment and is not executed. The word REM, followed by a space, must be placed at the beginning of the line.

Rationalizing the Autoexec.bat file

Destination of Autoexec.bat file

Let's first of all understand what the Autoexec.bat file is for. First of all, it allows you to download resident programs - all sorts of utilities. Secondly, you can create and modify the computer's computing environment: for example, replace the standard black and white DOS screen with a color using the PROMPT and ECHO commands included in the file, simplify the names of frequently used subdirectories, tell DOS where to find your favorite programs, and t .P. And thirdly, you can run one or more programs from autoexec.bat. For those who do not like working with the command line, configure this file so that it enters them directly into the menu, a GUI shell (like DOS or Windows), or another favorite application:

Attention : How to edit Autoexec.bat

Working with the file autoexec.bat, it's very easy to make mistakes. But fortunately, nothing terrible will happen if you make a mistake. Just DOS displays a message on the screen. Truth: Sometimes a mistake leads to the fact that your favorite hardware can not boot! :) In this regard, I advise you, before you start to modify the file, make yourself a backup boot floppy!

What are the resident programs and which ones will be needed?

In the DOS 6.x system, there are sixteen resident programs. At least that's what they write everywhere.
Some of them are useful, others are completely outdated, and some even are dangerous! But I, unfortunately, are not familiar with all the programs, here are some of them:

Doskey.com - allows you to call and edit the previous DOS command on the command line, and create and use powerful macros. Both of these features make it easy to work with the DOS command line, however, make sure that the doskey buffer is not too large. If you only edit commands, this buffer can be very small, in the event that there are many macros, the buffer should be expanded.

MSCDEX.EXE - provide general support for CD-ROMs. Before using this program, you must install the driver for the CD-ROM drive in the config.sys file.

SMARTDRV (SMARTDrive) is one of the few disk caching programs that can use memory together with Windows if necessary. In addition, if DoubleSpace is installed, it caches not the compressed disk, but the main one, and as a result, the efficiency of this operation doubles.

UNDELETE.EXE is a tool for recovering mistakenly erased files. Whether it is necessary for you, depends you understand from whom. Of course, the amount of memory it takes is offset by the security it gives!

If you are trying to improve autoexec.bat, then first of all it is best to see which resident programs it loads. One of the common mistakes among PC users is that they load a lot of resident programs in the autoexec.bat file, including those that are not needed very often. These people do not take into account that each utility selects part of the normal memory of the system and, if there are a lot of resident programs, the usual memory may not be enough for such applications as a word processor or spreadsheet!

How to make a black and white DOS screen color using the PROMPT and ECHO commands included in the file. (Autoexec.bat file)

This means that if ansi.sys driver was installed on your computers (for this, in the configuration file config.sys there should be a line of the device = directory name \ ansi.sys), only in this case it will be possible to use different colors of symbols and Background. For this, firstly, in autoexec, you need to set the ECHO command to ON ... Well, secondly, in the prompt command, you need to specify the control sequences of the ansi.sys driver:

$ E [<attribute>; ...; <attribute> m

Attribute values ​​are specified by decimal numbers. If the command specifies several attributes, then they are separated by semicolons. The values ​​of the attributes are: 0 - ordinary symbols (white on a black background), 1 - symbols of increased brightness, 5 - flashing symbols, 7 - inverse image (black symbols on a white background), 8 - invisible symbols (the color of the symbol coincides with the background color) , 30-37 - black, red, green, brown, blue, blue, and white characters, 40-47 - the colors of backgrounds respectively ...

For example, to get the yellow color of the characters, you need to use the command $ e [33; 1m

And to get the background, you write prompt $ e [44m

Here's a command like prompt $ e [44; 33; 1m sets the yellow color of letters
On a blue background