Smart Computing ® Smart Computing ®
Top Subscribe Today | Contact Us | Register Now   
middle
Home | Tech Support | Q&A Board | Article Search | Subscribe & Shop   


Using & Fixing Config.sys File Email This
Print This
View My Personal Library

Operating Systems
February 2000 • Vol.4 Issue 1
Add To My Personal Library

Using & Fixing Config.sys File

Jump to first occurrence of: [CONFIG.SYS]

Your computer does not know much on its own. It forgets most of its identity every time the power is shut off.

The main DOS startup file responsible for teaching your computer what it is when it wakes up in the morning is called Config .sys, short for configure the system. Config.sys is an ordinary text file stored in the root directory of a computer's boot drive, the drive on which the computer looks for its operating system. After DOS loads its most basic core programs into memory, it goes looking for Config.sys to fill in the missing pieces.

The main thing that Config.sys concerns itself with is memory, an expensive and precious resource in a computer that must be managed wisely. Your PC can run without a Config.sys file, but it may move much more slowly and certain programs may not open.

DOS also knows from Config.sys which device drivers, the small programs that let the computer interact with other hardware, to load into memory. Too many device drivers can eat up valuable space, but without a device driver, a particular piece of hardware, such as a special mouse, may not work.

Finally, Config.sys tells DOS which command processor to load. This is the program that accepts commands from the user and decides how to act upon them. Without some type of command processor, the computer becomes an unusable hunk of metal and silicon.

It isn't difficult to take a glance at a computer's Config.sys file, but before doing anything, it's a good idea to make a backup. To save a copy of your Config.sys file to a diskette, type

copy c:config.sys a:config.sys

at any C> prompt. This will copy your Config.sys file to whatever diskette is in the A: drive. Put it aside just in case. (For more information about backing up, see "Backup Strategies: Be Prepared For Hard Drive Problems" in this issue.)

Config.sys is stored right in your computer's root directory on the boot drive. For most computers, this is the C: drive. To make sure you are in the root directory, type cd\ and press ENTER. Repeat this until the command prompt reads C> without any directory names after it. If you like, type dir, which stands for the Directory command, to see which files are lurking about. They might scroll by too fast to read, but one of them should be Config.sys.

To see the contents of your Config.sys file, type



type config.sys



and press ENTER. The file should be displayed on-screen, followed by another C> prompt. Gaze upon your Config.sys file for a moment. Your computer reads these words each time it boots up. Most of these commands might seem unfamiliar because, unlike the commands in Autoexec.bat, they only can be used in Config.sys files. We'll explain most of them in a bit.

There's no way to change the contents of your Config.sys file from a TYPE listing such as this. Altering Config.sys requires some type of text editor. DOS 5.x and newer includes an easy-to-use, full-screen editor called EDIT. Older versions of DOS use a horrible line editor known as EDLIN. If you're using Windows, you can open Config.sys with Notepad.

To open Config.sys in EDIT, type



edit config.sys



and press ENTER. The same file you just viewed with the TYPE command should now appear in a word processing-like environment with File, Edit, and other pull-down menus strung across the top of the screen. Once again, before making any changes to Config.sys, be sure you've saved a backup somewhere. If you have a backup, be brave: All mistakes can be corrected.



Inside Config.sys.

It isn't easy to find two Config.sys files that look exactly alike because few computers are exactly alike. Different hardware and software setups can alter Config.sys, making your file a sort of "fingerprint" for your machine.

However, there are a number of things that every Config.sys file must accomplish. Here's a sample file containing some of the most common Config.sys elements we took from a computer with DOS 6.22 and no other software loaded on it.



Device=C:\DOS\Himem.sys

Device=C:\DOS\Emm386.exe Noems

Buffers=15,0

Files=30

DOS=UMB

Lastdrive=E

Fcbs=4,0

Devicehigh /L:1,12048 =C:\DOS\Setver.exe

DOS=High

Stacks=9,256



Your Config.sys file may or may not look like this one, but it probably has at least a few lines in common. Not all these lines are necessary in all computers, so don't worry if you're missing several. What matters is that your computer works the way it is.



Device Drivers.

The first task of our Config.sys file is to load device drivers and other programs that reside in memory during the entire time the computer is on. Device drivers are small programs that tell the computer how to use a particular piece of hardware or certain types of software. Config.sys' DEVICE command takes care of this important job.

The first device driver in our Config.sys is Himem.sys, the extended memory manager. Basically, this program tells the computer how to use extended random-access memory (RAM), the memory beyond the first 640 kilobytes (KB). You shouldn't need Himem.sys if you have less than one megabyte (MB) of RAM, if your central processing unit (CPU) is a 286 or slower, or if you use DOS 4.0 or older without Windows.

Next up is Emm386.exe, the expanded memory manager. Emm386.exe is used on computers with 386 or faster CPUs. Emm-386.exe deals with upper memory and can turn some extended RAM into expanded RAM. Emm386.exe only can be used if you also use the Himem.sys line. If your Himem.sys is in the WINDOWS directory, use the Emm386.exe in the WINDOWS directory, as well.

Our Emm386.exe line ends with the NOEMS command. This tells DOS to forget about enabling expanded RAM but to go ahead and manage the rest of upper memory. If you have no older programs that use expanded RAM, the NOEMS command can free up more memory for other programs.

You may notice that all these Device= lines require the full path name to reach the drivers. In this case, Himem.sys is located in the DOS directory. If you are using Windows, the driver is probably in the WIN DOWS directory. Without the path name spelled out in Config.sys, the computer will not be able to locate the correct files.

On some systems, you may find Setver.exe placed in a line. Setver.exe is a program that makes a newer version of DOS pretend to be an older version. This is so older programs can run in a newer DOS. If your DOS is older than version 5.0, you shouldn't need a Setver line.

Newer versions might need this line depending upon which software you want to run. If you don't run any old programs, removing a Setver line can free up some memory.

Config.sys may also load the Ansi.sys device driver, which is a screen driver that controls cursor movement, screen color, and keyboard definitions and is required by some programs and some dial-up bulletin board systems (BBSes). You can try deleting this line if you want to, and see if any error messages result when you try to run your programs.

Besides the device drivers dealing with memory, DOS version, and display, you probably will find a few others. For instance, one of our computers includes the Config.sys lines:



Device=C:\SCSI\Aspi2dos.sys /d /z

Device=C:\SCSI\Aspicd.sys /d:aspicd0



These lines load the device drivers for the particular kind of CD-ROM drive in our computer. Your computer may have lines somewhat similar to these that load drivers for your CD-ROM, sound card, scanner, modem, network card, and other hardware. Most of these lines are added automatically by the setup programs that come with new devices, although some might require you to manually type in the commands. If you or someone else has ever removed or switched hardware on your system, you might want to make sure no obsolete drivers are being loaded in Config.sys.

If you run the DoubleSpace or DriveSpace disk compression programs, you might find extra drivers that deal with these programs. It's probably a good idea not to change any of these settings, especially if things seem to be working.



Load 'Em High.

Devicehigh is similar to Device, and almost any device driver loaded with a Device line can be loaded with a Devicehigh line instead. Devicehigh tells DOS to load a driver in the upper area of memory instead of in the cramped base of RAM. This opens more conventional memory for running other programs. Devicehigh only can be used after Himem.sys and Emm386.exe are loaded, which is why you usually see Devicehigh lines toward the end of Config.sys.

To make sure Device and Devicehigh are being used in the best way possible for your computer, you can run DOS' MemMaker program, which is available in version 6.0 and newer. If you've never run MemMaker before, or if you have recently installed a new device, try out this valuable program. (MemMaker is a DOS utility that, when run, looks at your system and finds the optimum configuration.)

Drivers aren't the only programs that can be shooed away from base RAM. DOS can be loaded into extended memory with the DOS=High line. Left to its own preferences, DOS will load itself into scarce conventional memory. The DOS=High line must be preceded in Config.sys with the Himem.sys loading line, or DOS won't know where to find the upper memory.

If you are running Emm386.exe, you also can move some extra DOS utilities to upper memory by changing DOS=High to read like:



dos=high, umb



Again, MemMaker, if it's available, is probably the best way to make these sorts of changes.



Buffers.

Buffers are temporary storage areas in a computer's memory. When DOS reads information from the hard drive for a program, it first stores that information in memory buffers. Each buffer is the size of a disk sector, which often is 512KB. After the data is stored in buffers, it is passed along to the program.

This might seem like an unnecessary extra step, but buffers save a lot of time in the long run. Programs often request the same information over and over again.

With buffers, there is a good chance that DOS will be able to find that information in the superfast RAM rather than resorting to the relatively slow hard drive. Every trip to the hard drive that DOS can avoid slightly speeds up operations. The combined effect can be dramatic.

Likewise, information the program wants to write to the hard drive also is stored in buffers before being passed along to the drive. Then, if the program wants to access this information again, it is only a short RAM trip away.

The buffers usually are located in conventional memory. If DOS is loaded into extended memory, the buffers will be created there as well, unless there isn't enough room.

Config.sys' BUFFERS command tells DOS how much memory to devote to this buffering. If too many buffers are used, finding the information contained in them can take longer than using the hard drive.

Also, computers with little RAM to spare can decrease performance by devoting too much memory to buffers. The best balance for most users is a Buffers value of about 20, but this varies from machine to machine. A value of 15 is recommended for those using SmartDrive. If you don't have a Buffers line in your Config.sys file, the default is 15 for systems with more than 512KB of memory.

Some applications automatically change your Buffers line during their setup procedure. If this is the case and everything seems to be working, it's probably best to leave these values as they are.

However, nothing tragic will result from a bit of experimenting. Space also can be allocated to look-ahead buffering. This means that when DOS retrieves information from the hard drive, it reads a little more information than it needs, which could reduce future disk access calls. In this case, the line might look like this:



Buffers=20, 5



The first number is the number of standard, or read-write buffers, and the second number designates look-ahead buffers.



Files.

Some applications require a minimum number of file handles to be specified in Config.sys using the FILES command. File handles are the names the computer uses to refer to the open files it is using. The number of files a computer can open at once is limited to the number of file handles that can fit in the special memory area reserved for that purpose. A common number of file handles is 30, designated by a line like:



Files=30



Some programs might add such a line to Config.sys during installation. The default is 8, and the maximum is 255. Each handle after the first eight takes up 39 bytes of memory.

Some older applications demand File Control Blocks (FCBS) rather than file handles. You can see our sample Config.sys file contains lines for both so it will be able to deal with either type of program. The FCBS number can be anywhere from 1 to 255; the default is 4.

ShellDOS must know where to find the command processor file, the program that interprets commands typed at a prompt or from a batch file. The program included with DOS for this purpose is Command.com, which is usually located in the root directory of the boot drive. If Command.com has been moved for some reason, or you want to use a different command interpreter, you need to tell DOS with a Shell line in Config.sys.

On some computers, the Command.com file is located in the DOS directory. The appropriate Config.sys line for this case would be:



Shell=C:\DOS\Command.com



Stacks.

DOS also must set aside a portion of memory to support certain types of hardware. This is accomplished with the STACKS command. Some programs might add a Stacks line to your Config.sys or change the one you already have. Stacks are a bit more technical than some of the other aspects of Config.sys and probably should be left alone by most users.

Rounding out the rest of the Config.sys commands, in alphabetical order:

  • A Break=On line tells DOS to pay attention to the CTRL-C or CTRL-BREAK key combinations that users must sometimes press to escape from certain programs. Break can help you out with balky software, but it slows operations. If you don't need it, don't use it.

  • COMMENT is a command that doesn't get much use. It defines a string that can be followed in other Config.sys lines by extra text that is intended for humans rather than the computer.

  • The COUNTRY command is for use with foreign computer setups. This command won't cause DOS to print in different languages, but it can enable keyboards and displays to type and print in different languages.

  • The DRIVPARM command can reconfigure a disk or tape drive's parameters such as sector size. It is difficult to use and not recommended for anyone who isn't thoroughly familiar with DOS.

  • INSTALL loads certain terminate-and-stay-resident (TSR) programs, which are small applications that are available even when other programs are running. INSTALL is meant to be used mainly with DOSKEY, FASTOPEN, KEYB, NLSFUNC, and SHARE. INSTALLHIGH does the same job as INSTALL, but loads the TSR into upper memory.

  • Lastdrive=X, where X equals a letter between A and Z, tells your computer the maximum number of drives—hard drives, diskette drives, tape drives, etc.—it can access. LASTDRIVE can be useful if you use a RAM drive or add extra real drives. Don't, however, specify more drives than you need.

  • The simple NUMLOCK command tells the computer whether the NUMLOCK key on the keypad should be "on" or "off" at startup. Numlock=On means on, Numlock=Off means off.

  • The REM command has the same sort of idea as the COMMENT command. Any line beginning with REM will not be acted upon by the computer. This can be a useful debugging tool because you can use it to void lines without erasing them altogether.

  • Before DOS 6.0, SET was a command frequently seen in Autoexec.bat files. This command changes the variables that control DOS programs. In recent versions of DOS, SET has been used as a Config.sys command, although it still can be found in Autoexec.bat. (See "Using & Fixing Autoexec.bat Files" in this section.)

  • SWITCHES sets a few environmental variables. One of the most common uses of the command gets rid of the "Starting MS-DOS…" message that appears for two seconds every time you boot up your computer. If you are tired of the waiting each day and are sure you will not need to press F5 or F8 to bypass Config.sys (see below), the line Switches /F in the Config.sys file will eliminate the wait.



If you are running Windows NT or Windows 95 (Win95), you probably won't find these commands or any others in your Config.sys file. In fact, you might not find a Config.sys at all. Microsoft's latest operating systems don't require a Config.sys file, although some programs or hardware might still use it. In many cases, loading the old drivers in an ancient Config.sys can actually slow down Win95. Make a backup Config.sys and then try deleting the whole thing.



Disaster Recovery.

When you don't have Win95, your computer will run inefficiently or may not work properly with a faulty or missing Config.sys file. If you have a Config.sys file but think something is wrong with it, one way of pinning down the problem is to tell DOS to prompt you before performing any Config.sys command.

In prompting mode, the PC will ask you during startup whether each command should be skipped or performed. This lets users run lines they know are correct, while bypassing suspect commands. Prompting also can come in handy if you need to change your PC's configuration for a session, but you don't want to change the Config.sys file for good.

You can make the computer prompt you in this manner by pressing F8 when the screen says "Starting MS-DOS . . ." DOS then will show you each line of your Config.sys, followed by a [Y, N]? inquiry. Press the Y key if you want to execute that line or the N key if you want it skipped.

After Config.sys is complete, DOS will move to the Autoexec.bat file. It's possible to set up individual lines in Config.sys to prompt every time the system is started. For instance, if you wanted the option of whether to load a particular device driver, you could change the line:



Device=C:\DRIVERS\Driver.sys

to

device?=c:\drivers\driver.sys



The question mark always is inserted directly following the command word. It must be placed before any of the switches, equals signs, and other characters.

If you want to bypass the entire file without any prompting, press F5 when the "Starting MS-DOS…" appears on-screen during bootup. The computer will perform none of the commands in the Config.sys or Autoexec.bat files.

If you bypass Config.sys and your Command.com file isn't in your root directory, DOS may not be able to find it. If this happens, it will ask you to type in the file path to Command.com. Usually, this is: c:\dos\command.com.

Bypassing an entire balky Config.sys file is especially useful if you want to restore a backup copy of a previous working Config.sys. To do this, bypass the files and wait for the C> prompt to appear. Let's say our backup is named Config.bak and is stored on a diskette in the A: drive. In this case, you would type



copy a:config.bak c:config.sys



to restore your old file, reboot, and your computer should start up normally.



From Scratch.

If your Config.sys file has been completely erased or messed up beyond recognition, you may have to start over. As we said, your computer can run without a Config.sys file, but not to its full potential. Some devices may not work, and memory won't be well-managed.

The first step to take if you have no backup is to type in a simple, starter Config.sys file. If you're using a 286-based computer, try this one:



device=c:\dos\himem.sys

dos=high

device=c:\dos\setver.exe

device=c:\dos\ansi.sys

buffer=15

files=50

stacks=9,256



This basic file contains the commands that most 286s probably need. You can create this file using EDIT or the COPY CON command. Remember to save it in the root directory.

On a 386 or faster computer, we can get a little fancier. Type in the sample file we listed at the beginning of this article.

After you have a basic Config.sys file back in your root directory, reboot the computer. If you are using DOS 6.0 or newer, run Mem-Maker to make sure your memory is being used in the most efficient way possible.

Finally, look through software manuals to see if any of your programs need special lines in Config.sys to run correctly. If you can't find any manuals, you might try re-installing the software. Many programs make automatic changes to files such as Config.sys. Before you go to that trouble, you should run the applications you use to make sure re-installation is necessary. If everything seems to work all right, your Config.sys probably doesn't need tweaking.



Config.sys Menus.

If you are using DOS 6.0 or newer, you can alter your Config.sys to present you with menus and submenus of different configuration options every time you start your computer. This comes in handy if you have different programs with different memory needs or if one computer is shared by several users.

Let's take a simple example first. Say we only use our computer for two applications: a database and a word processor. The database must have expanded memory on hand, but when we use the word processor, it runs better with more extended memory. We want to tell Emm386.exe to forget about making expanded memory whenever we use the word processor.

Now look at the following Config.sys file:



[menu]

Menuitem=Word, Word Processing

Menuitem=Data, Database

Menudefault=Word

[common]

Device=C:\DOS\Himem.sys

DOS=HighBuffers=15,0

Files=25[word]

Device=C:\DOS\Emm386.exe Noems

[data]

Device=C:\DOS\Emm386.exe

[common]

DOS=UMB

Stacks=9,256



When you boot this machine, DOS will go through its startup routine and then present us with a menu that looks something like this:



MS-DOS 6.22 Startup Menu

1. Word Processing

2. Database

Enter a choice:



If you press the number 1, DOS performs the commands under the [word] block, then skips the [data] block and moves on to the second [common] block. No expanded memory is used. Pressing number 2 does the opposite; expanded memory is enabled, and we are ready for the database.

The Menudefault line in the [menu] block ensures that pressing any other number will have the same effect as pressing number 1. You also can set DOS to go with the default selection if no key if pressed for a certain length of time. For instance, the line



Menudefault=Word, 10



would make DOS select the [word] block after 10 seconds.

It also is possible to define submenus within menus. A possible scenario where this feature might come into play would be if two people shared the same computer. One person, Tom, uses the options described above while another person, Rhonda, must load French drivers for special international correspondence.

Rather than display all of Tom's options at the first menu, we could set up one menu to determine which person is using the computer and then go from there. To accomplish this, we'll use a Submenu= line, such as:



[menu]

Submenu=Tom, This is Tom

Menuitem=Rhonda, This is Rhonda

Menudefault=Tom,10

[common]

Device=C:\DOS\Himem.sys

DOS=High

Buffers=15,0

Files=25



[tom]Menuitem=Word, Word Processing

Menuitem=Data, Database

Menudefault=Word

[rhonda]

Country=033,850 C:\DOS\Country.sys

Devicehigh=C:\DOS\Display.sys

Con=( , 850, 1)

[word]

Device=C:\DOS\Emm386.exe Noems

[data]

Device=C:\DOS\Emm386.exe

[common]

DOS=UMB

Stacks=9,256



This Config.sys file would give Tom the choices he needs and Rhonda the ability to work in French without loading unnecessary drivers every time the computer is booted.

Another menu command is INCLUDE. If Rhonda in the above example wanted to run the word processor every time she logged on, we could put the line



include word



immediately after the Display.sys line in her [rhonda] menu. Whenever she logged on, her international drivers would be loaded, and the computer then would perform the actions listed in the [word] block then the [common] block.

After you have menus working the way you want, it's time to have some fun with Config.sys fashion colors. The MENUCOLOR command can change the background of a menu, as well as the text color. Each color is identified by a number code between 1 and 16 (see sidebar.) For example, if we wanted a white background with red text, we could put the line



Menucolor=5,8



at the beginning of our Config.sys file. The first number is the text color and the second number is the background color. This will liven up Config.sys—as if it wasn't exciting already.

by Alan Phelps


A Sample Config.sys File


Following is an example of a Config.sys file. Each line's meaning is explained in detail in the accompanying article.

Device=C:\DOS\Himem.sys

Device=C:\DOS\Emm386.exe Noems

Buffers=15,0

Files=30

DOS=UMB

Lastdrive=E

FCBS=4,0

Devicehigh /L:1,12048=C:\DOS\Setver.exe

DOS=High

Stacks=9,256







Want more information about a topic you found of interest while reading this article? Type a word or phrase that identifies the topic and click "Search" to find relevant articles from within our editorial database.

Enter A Subject (key words or a phrase):
ALL Words (‘digital’ AND ‘photography’)
ANY Words (‘digital’ OR ‘photography’)
Exact Match ('digital photography'- all words MUST appear together)





Home     Copyright & Legal Information     Privacy Policy     Site Map     Contact Us

Copyright © 2010 Sandhills Publishing Company U.S.A. All rights reserved.