System command

chkdsk command

Check a volume's file system and, with selected switches, attempt repairs.

Availability: Microsoft Learn command reference spanning Windows client and Windows Server releases; some entries are legacy, role-specific, optional-feature or interactive subcommands.中文

Documented syntax

chkdsk [<volume>[[<path>]<filename>]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:<size>]] [/b] [/scan] [/forceofflinefix] [/perf] [/spotfix] [/sdcleanup] [/offlinescanandfix] [/freeorphanedchains] [/markclean] [/?]

The linked Microsoft Learn article is the upstream authority. Availability may depend on Windows release, role, optional feature or interactive tool context.

Examples

Example usage for chkdsk.

chkdsk C: /scan

Parameters, options and clauses

Option / clauseDescription
<volume>Select the drive to examine.
/fFix file-system errors; may require a locked volume or restart.
/rLocate bad sectors and recover readable information; implies /f.
/scanRun an online scan on an NTFS volume.
/spotfixSpot-fix errors on an NTFS volume.
---Microsoft documents this switch; use the linked reference for accepted values, effects and version limits.
[<path>]<filename>Microsoft documents this argument or subcommand; check the linked reference for its required format and context.
<path>Microsoft documents this argument or subcommand; check the linked reference for its required format and context.
<filename>Microsoft documents this argument or subcommand; check the linked reference for its required format and context.
/vMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/xMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/iMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/cMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/lMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
<size>Microsoft documents this argument or subcommand; check the linked reference for its required format and context.
/bMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/forceofflinefixMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/perfMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/sdcleanupMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/offlinescanandfixMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/freeorphanedchainsMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/markcleanMicrosoft documents this switch; use the linked reference for accepted values, effects and version limits.
/?Display command help or the supported command-line usage.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory