MS-DOS and Windows command line ScanDisk command

Updated: 05/21/2018 by Computer Hope
ScanDisk command

Microsoft ScanDisk was first introduced with MS-DOS 6.2. It is a software utility capable of checking the hard drive and floppy diskette for any disk errors.

Tip

For newer versions of Windows, use the chkdsk command to check your hard drive from the command line.

Warning

You cannot run ScanDisk from a command line while Windows is running. Boot the computer to a safe mode command prompt and then run ScanDisk.

Availability

ScanDisk is an external command that is available for the following Microsoft operating systems.

  • MS-DOS 6.2 and above

ScanDisk syntax

Windows XP and later syntax

The ScanDisk command line command is deprecated and was replaced with the chkdsk command.

Windows 98 and ME syntax

scandisk [ drive: | volume_name | /all] [/checkonly | /autofix [/nosave] | /custom] [/fragment] [/surface] [/mono] [/nosave] [/nosummary]
drive: The drive letter you want to scan.
volume_name The name of the unmounted compressed volume.
/all Checks and repairs all the local drives at once.
/checkonly Checks drive for errors but will not make repairs.
/autofix Fixes errors without asking you first. Saves lost clusters by default as files in the drive's root directory. Cannot be used with /checkonly or /custom.
/custom Runs ScanDisk using the settings in the [custom] section of the scandisk.ini file. Cannot be used with /autofix or /checkonly.
/surface Automatically checks surface after other areas are tested without prompting you first. When used with /custom, will override any /surface setting in the [Custom] section of scandisk.ini.
/fragment Checks individual files for fragmentation. Must specify a drive, path, and file name; cannot use any other switches.
/mono Uses a monochrome display instead of color.
/nosave Deletes all lost clusters found by ScanDisk. Can be used with /autofix.
/nosummary Prevents display of full-screen summary after each drive. Use with /autofix to prevent prompts for undo diskette.

MS-DOS 6.0 and earlier syntax

scandisk [ drive: | drive:\path\file name | volume_name | /all] [/checkonly | /autofix [/nosave] | /custom] [/fragment] [/surface] [/mono] [/nosave] [/nosummary]
drive: The drive letter you want to scan.
drive:\path\file name The drive and path or file name you want to scan.
volume_name The name of the unmounted compressed volume.
/all Checks and repairs all local drives at once.
/checkonly Checks drive for errors but will not make repairs.
/autofix Fixes errors without asking you first. Saves lost clusters by default as files in the drive's root directory. Cannot be used with /checkonly or /custom.
/custom Runs ScanDisk using the settings in the [custom] section of the scandisk.ini file. Cannot be used with /autofix or /checkonly.
/surface Automatically checks surface after other areas are tested without prompting you first. When used with /custom, will override any /surface setting in the [Custom] section of scandisk.ini.
/fragment Checks individual files for fragmentation. Must specify a drive, path, and file name; cannot use any other switches.
/mono Uses a monochrome display instead of color.
/nosave Deletes all lost clusters found by ScanDisk. Can be used with /autofix.
/nosummary Prevents display of full-screen summary after each drive. Use with /autofix to prevent prompts for undo diskette.

ScanDisk examples

scandisk c: /autofix

Runs ScanDisk on the primary hard drive for any errors and if found automatically fix those errors.