ScanDisk Runs After Improper Shutdown or Hard Disk Error

ID: Q152404


The information in this article applies to:


SYMPTOMS

You may receive one of the following error messages when Windows starts:


CAUSE

These error messages can occur if your computer was not shut down properly or when an error occurs on a hard disk.


RESOLUTION

To resolve these errors, press any key to allow ScanDisk to perform the necessary checks on all drives, and then choose to repair any errors found.

NOTE: To properly shut down Windows, click the Start button, click Shut Down, and then click Shut Down The Computer. You should not turn off the computer while Windows is running unless the computer has stopped responding to mouse and keyboard input.


MORE INFORMATION

OSR2 includes versions of the Io.sys and Win.com files that check the Clean Shutdown and Hard Disk Error bits in the Virtual File Allocation Table (VFAT) during startup. If either of these bits is turned on (that is, cleared to 0) on any drive present in real mode, you are prompted to run ScanDisk. If you do not press a key within 60 seconds, ScanDisk runs anyway.

The Clean Shutdown and Hard Disk Error bits are the two low-order bits of the FAT entry for cluster 1. If bit 0 is 0, it indicates an unclean shutdown; if bit 1 is 0, it indicates that a hard disk error occurred on that drive. These bits are turned on by VFAT; they are turned off only by ScanDisk. The Clean Shutdown bit is turned off upon completion of a standard run. The Hard Disk Error bit is turned off upon completion of a surface scan (regardless of whether errors were repaired).

If either of these bits is on for a real-mode drive, Win.com displays the appropriate error message. Pressing any key starts the following command:

SCANDISK.EXE /CUSTOM x: [[y:] ...]

If the Hard Disk Error bit is on for any drive, the /SURFACE switch is included in the command. Note that if the Clean Shutdown bits are off, but one or more Hard Disk Error bits is on, you receive a different error message about why ScanDisk is being started.

If ScanDisk does not find any errors, or if you choose to fix all errors, ScanDisk should finish and Windows 95 should continue loading. Note that the default behavior of the /CUSTOM switch is that ScanDisk displays a summary screen if any errors are found, but if not, ScanDisk quits silently.

If Scandisk.exe is not found, Win.com displays the following error message:
SCANDISK.EXE could not be found. You may have problems on your disks(s) that require repairing. Press any key to continue starting Windows...

If you quit ScanDisk early, leaving errors on the disk, or if ScanDisk is unable to finish, Win.com displays the following error message:
There was an error running SCANDISK.EXE, or it was canceled. You may still have errors on your disk(s). Press any key to continue starting Windows...

NOTE: If ScanDisk does not reach the point where it turns the Clean Shut- down and Hard Disk Error bits off, ScanDisk runs again the next time your computer starts.

Autoscan Settings in Msdos.sys File

To modify this default behavior, the following new settings have been defined for the [Options] section of the Msdos.sys file:
NOTE: You can also automate ScanDisk so that no user intervention is required by editing settings in the C:\Windows\Command\Scandisk.ini file and specifying the actions you want ScanDisk to take in Custom mode.

Additional query words: 95


Keywords          : kberrmsg kbtool osr2 diskmem win95 win98 
Version           : 95
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: January 28, 1999