Microsoft DOS scandisk command

Quick links

About scandisk
Availability
Scandisk syntax
Scandisk examples
Scandisk Q&A

About scandisk

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

Tip: For new versions of Windows if you want to check your hard drive from the command line use the chkdsk command.

Warning: For versions of Windows that support running ScanDisk from a command line do not run ScanDisk on the hard drive running Windows while Windows is running. Reboot the computer and boot the computer to a safe mode command prompt and then run ScanDisk.

Availability

The ScanDisk command is an external command that is available in the below Microsoft operating systems.

MS-DOS 6.2 and above

Tip: How do I run Microsoft ScanDisk in Windows?

ScanDisk syntax

Windows XP and later syntax
Windows 98 and ME syntax
MS-DOS 6.0 Defrag syntax

Windows XP and later syntax

The scandisk command line command has been deprecated and replaced with the chkdsk command. Use the chkdsk command if you want to check a disk from the Windows command line.

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 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 [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 [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\filename | volume_name | /all] [/checkonly | /autofix [/nosave] | /custom] [/fragment] [/surface] [/mono] [/nosave] [/nosummary]

drive: The drive letter you want to scan.
drive:\path\filename The drive and path or filename 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 [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 [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

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