How to Use CHKDSK using Command Prompt

If you’re willing to use the Command Prompt (or you have to because Windows won’t boot properly), you can exert a little more control over the disk-checking process. Plus, if you’re using Windows 10 or Windows 11 , it’s the only way to force automatic fixing or bad sector scanning into the mix. Open up the Command Prompt with administrative privileges by hitting Windows+X and selecting “Command Prompt (Admin).” You’ll be using the chkdsk command. The command supports a number of optional switches, but we’re mostly concerned with two of them: /f and /r.

If you just use the chkdsk command by itself, it will scan your drive in read-only mode, reporting errors but not attempting to repair them. For this reason, it can usually run without having to restart your PC.

Here’s how to run CHKDSK from Command Prompt on Windows:

  1. Type chkdsk and hit Enter. CHKDSK will scan for drive errors and let you know if it found any you should repair, but it won’t try to fix them without a command.
  2. Type cmd (Command Prompt) in the Start menu search bar, then click Run as administrator.
  3. This command should work for all Windows versions, whether you’re running CHKDSK on Windows 11 or Windows 7.

How to change a scheduled disk check

When a CHKDSK scan is scheduled to run the next time you boot up your PC, it will run automatically. On an older or slower machine, this could increase your boot time significantly. But you can always schedule your CHKDSK scan to run later if you prefer to wait.

Here’s how to schedule your disk check:

  1. Type cmd in the search field to open Command Prompt, then click Run as administrator.
  2. Enter the command chkntfs /t:[000]. The [000] should be substituted by the number of seconds (up to 259,200 seconds or 72 hours) you want CHKDSK to wait before scanning. For example, chkntfs /t:60 means CHKDSK will count down from 60 seconds before starting your hard disk scan.

You can set up a scheduled disk check to fit your needs in this way. Scheduled disk checks are great for your computer, just like clearing out the Windows Registry every so often.

Important Chkdsk Commands

There are, of course, other parameters you can use with chkdsk . So, for the sake of completeness — and your geeky enjoyment — here they are:

  • C:\>chkdsk /? Checks a disk and displays a status report.
  • CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]] [/B]
    • volume Specifies the drive letter (followed by a colon), mount point, or volume name.
    • filename FAT/FAT32 only: Specifies the files to check for fragmentation.
    • /F Fixes errors on the disk.
    • /V On FAT/FAT32: Displays the full path and name of every file on the disk. On NTFS: Displays cleanup messages if any.
    • /R Locates bad sectors and recovers readable information (implies /F).
    • /L:size NTFS only: Changes the log file size to the specified number of kilobytes. If size is not specified, displays current size.
    • /X Forces the volume to dismount first if necessary. All opened handles to the volume would then be invalid (implies /F).
    • /I NTFS only: Performs a less vigorous check of index entries. /C NTFS only: Skips checking of cycles within the folder structure.
    • /B NTFS only: Re-evaluates bad clusters on the volume (implies /R) /scan NTFS only: Runs an online scan on the volume
    • /forceofflinefix NTFS only: (Must be used with “/scan”) Bypass all online repair; all defects found are queued for offline repair (i.e. “chkdsk /spotfix”).
    • /perf NTFS only: (Must be used with “/scan”) Uses more system resources to complete a scan as fast as possible. This may have a negative performance impact on other tasks running on the system.
    • /spotfix NTFS only: Runs spot fixing on the volume /sdcleanup NTFS only: Garbage collect unneeded security descriptor data (implies /F).
    • /offlinescanandfix Runs an offline scan and fix on the volume.
    • /freeorphanedchains FAT/FAT32/exFAT only: Frees any orphaned cluster chains instead of recovering their contents.
    • /markclean FAT/FAT32/exFAT only: Marks the volume clean if no corruption was detected, even if /F was not specified.

The /I or /C switch reduces the amount of time required to run Chkdsk byskipping certain checks of the volume

Should you use CHKDSK /f or /r?

  • The chkdsk /f command prevents crashes by making sure the file system directory is accurate.
  • The chkdsk /r command surrounds parts of the drive that are damaged and tells Windows not to use them — ensuring that files only get written to the working parts of the hard drive, preventing them from getting corrupted. Files in damaged parts of the drive get relocated somewhere undamaged.

Before you run CHKDSK /r, you’ll want to back up important files. There’s a small chance that part of a file is written close to an unreadable sector and it gets removed from the file system along with the rest.

Hopefully, Chkdsk will fix whatever hard drive problems you may have, and you can go back to using your computer normally.