Previous Section  < Day Day Up >  Next Section

Hack 91 Hack the Windows 95/98/Me DOS Startup

figs/moderate.gif figs/hack91.gif

Gain more control and boot faster by customizing this DOS configuration file.

In this hack, you'll learn ways to customize how DOS boots and to make booting up faster.

9.8.1 A Typical MSDOS.SYS File

Windows 95, 98, and Me use a file called MSDOS.SYS to configure the initial boot process. MSDOS.SYS resides in the root folder of the boot drive with Read-Only, System, and Hidden file attributes. The MSDOS.SYS file contains sections of information pertaining to the Windows installation and boot options. The [Paths] section of the file lists information about Windows' files (the Windows folder and location of the Registry), and the [Options] section holds information about customizing bootup.

Under DOS 6.22 and earlier, MSDOS.SYS is a binary program file critical to basic DOS operation and is not editable. Only with the DOS supplied in Windows 95 and higher is the MSDOS.SYS file an editable text file.


To view and edit the contents of the C:\MSDOS.SYS file, you must first remove the Read Only and Hidden file attributes. To do this, get to a DOS prompt (in Windows, open MS-DOS Prompt or go to StartRun, type in COMMAND.COM, and then click OK) and issue the following commands:

X:\>C:

C:\FOO>CD \ 

C:\>attrib -r -h

When you are done editing MSDOS.SYS, restore its attributes with attrib +r +h +s MSDOS.SYS.


Note that there are spaces between the -r, -h, and -s in the previous command. The file is now ready to be viewed or edited with a plain text editor like DOS Edit, Windows Notepad, or similar. The contents of the file may look like this:

;FORMAT [Paths] WinDir=C:\WINDOWS

WinBootDir=C:\WINDOWS HostWinBootDrv=C [Options] BootMulti=1

BootGUI=1 DoubleBuffer=1 AutoScan=1 WinVer=4.10.1998 ; ;The following

lines are required for compatibility with other programs. ;Do not

remove them (MSDOS.SYS needs to be >1024 bytes).

;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa

;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxb

;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc

;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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxr

;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxs

The contents are typical of a default Windows 9x-Me installation. It says that Windows is installed in and runs from the C:\WINDOWS folder on drive C:, it is possible to interrupt the boot process to stop at a DOS prompt rather than load Windows without interruption, the Windows GUI is loaded, the Double Buffer setting is asserted if the disk drive interface needs it, and Scandisk is run with prompts if the system was not shut down properly before.

A variety of other parameters is set by default but not shown under the [Options] section of the file. These are:

BootDelay=2 BootKeys=0 BootMenu=0

BootMenuDefault=1 BootMenuDelay=30 BootSafe=0 DblSpace=1 DrvSpace=1

LoadTop=1 Logo=1 Network=0

These parameters mean that:


BootDelay=2, BootKeys=0

You have two seconds during which "Starting Windows" is displayed to press one of the F-keys to alter the boot process (except that the F-keys are disabled).


BootMenu=0

No boot menu is presented.


BootMenuDefault=1

The default selection for the boot menu, if it is presented, is 1 (the normal operating system).


BootMenuDelay=30

If the boot menu is presented, it will show for 30 seconds before the default selection is used.


BootSafe=0

The system will not boot into Safe mode.


DblSpace=1, DrvSpace=1

The DblSpace and DrvSpace disk compression drivers will load.


LoadTop=1

DOS and drivers will load at the top of DOS memory.


Logo=1

The Windows startup logo will be displayed.


Network=0

No network is configured, so you won't get a "Safe mode with networking support" option on the boot menu.

To give you more control over the optimization of the boot process, the following settings can be changed or added under the [Options] section of the file:

BootDelay=5 BootKeys=1 BootMenu=1 BootMenuDelay=5

DblSpace=0 DrvSpace=0 Logo=0 Network=1

Adding BootDelay=5 gives you more time to respond with any boot key selections. BootKeys=1 shows you the F-key options for bootup at the bottom of the screen. BootMenu=1 turns on the boot menu. BootMenuDelay=5 lets the menu stay on the screen for only 5 seconds instead of 30. DblSpace=0 and DrvSpace=0 specify that these drivers will not be loaded. Logo=0 mandates that the Windows startup logo will not be displayed. Finally, if you have a network setup you can have support for it if you start Windows in Safe mode by adding Network=1.

The advantages to these changes are that you can exercise more control over bootup, the menu doesn't hang around forever, and you do not tie up resources loading and displaying the Windows logo.

9.8.2 The Details of MSDOS.SYS

The [Paths] section of MSDOS.SYS may contain the following information (default values for each parameter follow the parameter's name in parentheses):


HostWinBootDrv= Root of Boot Drive (C )

The location for the root of the boot drive.


UninstallDir= Root of Boot Drive (C )

Specifies the location of the W95undo.dat and W95undo.ini files. These files are necessary to uninstall Windows 95.


WinBootDir= Windows Folder (usually C:\Windows )

The location of the necessary files for booting.


WinDir= Windows Folder (usually C:\Windows )

The location of the Windows folder

The [Options] section of MSDOS.SYS may contain the following information:


AutoScan= Number (1 )

Specifies if ScanDisk is to be run after a bad shutdown. 0 does not run ScanDisk; 1 prompts before running ScanDisk; 2 runs ScanDisk but prompts before fixing errors if any are found. This setting is available to Windows 95 OEM Service Release 2 and later.


BootDelay= Seconds (2 )

The amount of time the "Starting Windows" message appears before Windows continues to boot. BootDelay is not supported in Windows 98.


BootSafe= Boolean (0 )

1 forces Windows into Safe mode.


BootGUI= Boolean (1 )

1 forces Windows to load. 0 disables the loading of Windows.


BootKeys= Boolean (1 )

1 enables the use of the function keys F4, F5, F6, F8, and CTRL to override other settings. 0 disables the function keys during boot.


BootMenu= Boolean (0 )

1 enables the DOS startup menu. If 0, you must press F8 when "Starting Windows" appears to use the Startup menu.


BootMenuDefault= Number (1 or 3 )

Use this setting to set the default menu item for startup. The default parameter is 1 if the system is running correctly and 3 if the system hung in the previous instance


BootMenuDelay= Number (30 )

The number of seconds your system shows the Startup menu. After this time expires, the BootMenuDefault is used and the system boots with it. BootMenu=1 must be set for this to work.


BootMulti= Boolean (1 )

0 disables the ability to select your previous operating system (typically DOS).


BootWarn= Boolean (1 )

0 disables the Safe-mode boot warning and the Startup menu.


BootWin= Boolean (1 )

1 forces Windows's GUI to load.


DoubleBuffer= Boolean (0 )

1 enables double-buffering for disk adapters that need it (most SCSI and some SCSI-like IDE disk adapters). 2 enables double-buffering regardless.


DBLSpace= Boolean (1 )

1 allows loading the DBLSPACE.BIN disk compression driver. 0 disables it. Set 0 if you do not have compressed drives.


DRVSpace= Boolean (1 )

1 allows loading the DRVSPACE.BIN disk compression driver. 0 disables it. Set 0 if you do not have compressed drives.

If you don't know anyone who has used the DOS disk compression feature in over 12 years), loading the disk compression driver wastes time and memory.


To disable the disk compression driver from being loaded, set both DBLSPACE=0 and DRVSPACE=0.

One way to tell if a drive has been compressed is to boot to DOS without loading the compression drivers, then get a directory listing of the hard drive with DOS's DIR. You will see a large file named either DBLSPACE.000 or DRVSPACE.000, which contains the contents of the compressed drive. You cannot format or partition a compressed drive because it is merely a large file containing the data that was on the previously uncompressed drive.


LoadTop= Boolean (1 )

1 causes COMMAND.COM and, if enabled, DRVSPACE.BIN and DBLSPACE.BIN to load at the top of DOS's 640K memory space.


Logo= Boolean (1 )

1 causes the Windows boot logo to appear. 0 does not show the logo and can fix problems with some memory managers.


Network= Boolean (0 )

1 tells DOS a network is or was installed and adds the "Safe mode with network support" option to the Start menu.

9.8.3 The "Junk" at the End of the MSDOS.SYS File

The MSDOS.SYS file also contains a large section of filler characters that are necessary to keep the file large enough for programs that expect the MSDOS.SYS file to be at 1,024 bytes or larger. Leave this block of characters as is to ensure proper operation of your applications.

    Previous Section  < Day Day Up >  Next Section