----------------------- MS-DOS v6.22 Help: SCANDISK ------------------------
<Notes> <Examples>                                               <Index>
----------------------------------------------------------------------------

                                  SCANDISK

Starts Microsoft ScanDisk, a disk analysis and repair tool that checks a
drive for errors and corrects any problems that it finds. For an
introduction to using ScanDisk, see <An Introduction to ScanDisk>.

Syntax

To check the current drive for disk errors, use the following syntax:

    SCANDISK

To check one or more drives for disk errors, use the following syntax:

    SCANDISK [drive: [drive: ...]|/ALL] [/CHECKONLY | /AUTOFIX [/NOSAVE] |
    /CUSTOM] [/SURFACE] [/MONO] [/NOSUMMARY]

To check an unmounted compressed volume file for errors, use the following
syntax:

    SCANDISK volume-name [/CHECKONLY | /AUTOFIX [/NOSAVE] | /CUSTOM] [/MONO]
    [/NOSUMMARY]

To check a file or files for fragmentation, use the following syntax:

    SCANDISK /FRAGMENT [drive:][path]filename

To undo repairs you made previously, use the following syntax:

    SCANDISK /UNDO [undo-drive:] [/MONO]

Parameters

drive:
    Specifies the drive or drives you want to check and repair.

volume-name
    Specifies the name of the unmounted compressed volume file you want to
    check and repair. The volume-name parameter should take the form
    [drive:\]DRVSPACE.nnn, in which drive specifies the drive that contains
    the volume file and nnn specifies the extension of the volume file. For
    example, H:\DRVSPACE.000.

[drive:][path]filename
    Specifies the file(s) you want to examine for fragmentation. You can
    also specify wildcards for the filename.

undo-drive:
    Specifies the drive containing the Undo disk.

Switches

/ALL
    Checks and repairs all local drives.

/AUTOFIX
    Fixes damage without prompting you first. By default, if you start
    ScanDisk with the /AUTOFIX switch and ScanDisk finds lost clusters on
    your drive, it saves the lost clusters as files in the drive's root
    directory. To have ScanDisk delete lost clusters rather than saving
    them, include the /NOSAVE switch. (If you use the /AUTOFIX switch and
    ScanDisk finds errors, it still prompts you for an Undo disk; to prevent
    this, include the /NOSUMMARY switch.) You cannot use the /AUTOFIX switch
    in conjunction with the /CHECKONLY or /CUSTOM  switches.

/CHECKONLY
    Checks a drive for errors, but does not repair any damage. You cannot
    use this switch with the /AUTOFIX or /CUSTOM switches.

/CUSTOM
    Runs ScanDisk using the configuration settings in the [Custom] section
    of the SCANDISK.INI file. This switch is especially useful for running
    ScanDisk from a batch program. You cannot use this switch in conjunction
    with the /AUTOFIX or /CHECKONLY switches.

/MONO
    Configures ScanDisk to use a monochrome display. Instead of specifying
    this switch every time you run ScanDisk, you can include the
    DISPLAY=MONO line in your SCANDISK.INI file.

/NOSAVE
    Directs ScanDisk to delete any lost clusters it finds. Can be used only
    in conjunction with the /AUTOFIX switch. (If you start ScanDisk with the
    /AUTOFIX switch and omit the /NOSAVE switch, ScanDisk saves the contents
    of any lost clusters as files in the root directory of the drive.)

/NOSUMMARY
    Prevents ScanDisk from displaying a full-screen summary after checking
    each drive. (This switch also prevents ScanDisk from prompting you for
    an Undo disk if it finds errors.)

/SURFACE
    Automatically performs a surface scan after checking other areas of a
    drive. During a surface scan of an uncompressed drive, ScanDisk confirms
    that data can be reliably written and read from the drive being scanned.
    During a surface scan of a compressed drive, ScanDisk confirms that data
    can be decompressed. You should periodically do surface scans of all
    drives.

    By default, when it has finished checking a drive's file system,
    ScanDisk asks whether or not you want to perform a surface scan.
    However, if you specify the /SURFACE switch, ScanDisk proceeds with the
    surface scan without prompting you first. When /SURFACE is used in
    conjunction with the /CUSTOM switch, it overrides the Surface setting in
    the [Custom] section of the SCANDISK.INI file.

                                      ***

<Syntax> <Examples>
----------------------------------------------------------------------------

                              SCANDISK--Notes


Problems fixed by ScanDisk

ScanDisk checks and fixes problems in the following areas of each drive:

*  File allocation table (FAT)

*  File system structure (lost clusters, crosslinked files)

*  Directory tree structure

*  Physical surface of the drive (bad clusters)

In addition, ScanDisk also checks and fixes the following areas of a
DriveSpace or DoubleSpace compressed drive:

*  Volume header (MDBPB)

*  Volume file structure (MDFAT)

*  Ccompression structure

*  Volume signatures

*  MS-DOS boot sector

Types of drives

ScanDisk can find and fix errors on the following types of drives:

*  Hard drives

*  DriveSpace drives

*  DoubleSpace drives (if DoubleSpace is installed)

*  Floppy disk drives

*  RAM drives

*  Memory cards

ScanDisk cannot find or fix errors on the following types of drives:

*  CD-ROM drives

*  Network drives

*  Drives created by using the ASSIGN, SUBST, or JOIN commands

*  Drives created by using INTERLNK

Using ScanDisk when other programs are running

Do not use ScanDisk to repair a drive when other programs are running.
ScanDisk is designed for use when files on a disk are in an unchanging
state. When you are using a file, MS-DOS updates the file allocation table
(FAT) and the directory structure to reflect changes. Such updates are not
always made immediately. If you run ScanDisk when other programs are
running, files might still be open. ScanDisk interprets differences between
the directory structure and the file allocation tables as errors. This can
result in corruption or loss of data.

You cannot use ScanDisk to correct disk errors if you start it from another
program, or when Microsoft Windows or MS-DOS Task Swapper are running.
However, you can check your disk without fixing errors by using the SCANDISK
command with the /CHECKONLY switch. If you run it with Windows, ScanDisk
might detect errors that do not exist when Windows is not running.

Using ScanDisk with PC-DOS 6.1

Do not run ScanDisk on any PC-DOS 6.1 compressed drive. If you do, you will
lose all data on that drive. ScanDisk is compatible only with MS-DOS
compressed drives (DriveSpace drives and DoubleSpace drives) and is not
designed to run on PC-DOS compressed drives.

Using ScanDisk on DoubleSpace Drives

If DoubleSpace is installed (that is, if DBLSPACE.BIN is loaded into
memory), ScanDisk can check and repair DoubleSpace drives and unmounted
DoubleSpace compressed volume files. ScanDisk can also check and repair
DoubleSpace drives and volume files if the DBLSPACE.BIN and DRVSPACE.MR1
files are available. Otherwise, ScanDisk does not work on DoubleSpace drives
or unmounted DoubleSpace compressed volume files. For more information about
the DRVSPACE.MR1 file, see the README.TXT file. (For more information about
using DoubleSpace with MS-DOS 6.22, see <DBLSPACE>.)

The SCANDISK.INI file

The SCANDISK.INI file is a text file located in the directory that contains
your MS-DOS files. The settings in the [Environment] section of the
SCANDISK.INI file determine certain aspects of ScanDisk's behavior, such as
whether it is configured for a monochrome or color display. The settings in
the [Custom] section determine the default behavior of ScanDisk when you
start it with the /CUSTOM switch.

For more information, read the comments in the SCANDISK.INI file.

Undoing the changes ScanDisk made

If ScanDisk finds errors on your drive, the program gives you the option of
creating an Undo disk, which enables you to undo the changes ScanDisk makes
to your drive. The Undo disk contains information that specifies which drive
it applies to as well as information on every change that ScanDisk made to
that drive.

CAUTION:  Use the Undo disk to undo changes only if your drive has not
          changed since that Undo disk was created. If you changed any of
          the files on your drive since you created the Undo disk, do not
          try to undo your changes. If you attempt to use the Undo disk
          after you update a file or directory, or copy or delete a file,
          you might damage your drive structure and lose data.

ScanDisk Errorlevels

When ScanDisk returns to the command prompt, it sets ERRORLEVEL to one of
the following:

0
    ScanDisk did not detect any problems on the drive(s) it checked.

1
    ScanDisk could not run because the command-line syntax was incorrect.

2
    ScanDisk terminated unexpectedly due to an out-of-memory error or an
    internal error.

3
    The user chose to exit before ScanDisk had finished.

4
    ScanDisk completed all logical checks on all drives, but the user exited
    from one or more surface scans before the scans were complete.
    Errorlevel 4 is not returned if the user chose to bypass the surface
    scans completely.

254
    ScanDisk found disk problems and corrected them all.

255
    ScanDisk found disk problems, but not all problems were corrected.

                                      ***

<Syntax> <Notes>
----------------------------------------------------------------------------

                             SCANDISK--Examples

To check and fix the current drive, type the following:

    scandisk

Suppose that DriveSpace is installed, but is unable to mount your compressed
drive because of problems with the drive. The drive's compressed volume file
is called DRVSPACE.000 and is located in the root directory of drive C. To
repair the volume file, type the following:

    scandisk c:\DRVSPACE.000

The DriveSpace volume file must be located in the root directory of the
drive.

To check both drive C and drive E, type the following:

    scandisk c: e:

To check all your drives, type the following:

    scandisk /all

This will check all your hard disk partitions, in addition to all mounted
DriveSpace drives (if DriveSpace is installed).

Suppose you created an Undo disk, did not change the contents of the checked
drive since you created the Undo disk, and placed the Undo disk in drive A.
To undo the changes made by ScanDisk,  type the following:

    scandisk /undo a:

                                      ***

----------------------------------------------------------------------------
<Top of page>
Last update: December 07, 2002 14:45 by
Content © 1997 Microsoft Corporation
All else © 2000-2005
Counter