How to Schedule CHKDSK Surface Scan (/f /r) for Next Boot in Windows – Complete Technical Guide


12 views

When you run chkdsk d: /f /r in Windows, the system immediately attempts to lock the volume and initiate the scan. This becomes problematic when:

  • The disk contains running system processes
  • You need immediate system shutdown capability
  • Background services might interfere with scan accuracy

The proper command to schedule for next reboot is:

chkntfs /x d:
chkdsk d: /f /r

This two-step process:

  1. Excludes the volume from automatic startup checking
  2. Marks the volume for a full surface scan with bad sector recovery

To confirm your scheduled scan:

fsutil dirty query d:

For scripting scenarios, use this PowerShell alternative:

Repair-Volume -DriveLetter D -Scan -SpotFix -OfflineScanAndFix

For systems where standard methods fail, create this registry entry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
"BootExecute"=hex(7):61,00,75,00,74,00,6f,00,63,00,68,00,65,00,63,00,6b,00,20,\
  00,61,00,75,00,74,00,6f,00,63,00,68,00,6b,00,20,00,2a,00,20,00,2f,00,73,00,\
  00,00,00,00

If scheduled scans don't trigger:

  • Check for pending Windows updates requiring restart
  • Verify sufficient disk space (minimum 15% free)
  • Disable Fast Startup in power settings

Running chkdsk d: /f /r often triggers an immediate scan, which isn't ideal when:

  • You need immediate system mobility
  • Background processes may interfere with disk operations
  • Concurrent disk I/O could slow down the check
  • You want the scan to run in a pristine boot environment

Use this command to queue CHKDSK for the next reboot:

chkntfs /x d:
chkdsk d: /f /r

Breakdown:

  1. chkntfs /x d: - Excludes D: from automatic boot-time checking
  2. chkdsk d: /f /r - Schedules the detailed scan for next restart

Check scheduled disk scans:

fsutil dirty query d:

Sample output if scheduled:

Volume D: is dirty

For scripting scenarios, create a REG file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
"BootExecute"="autocheck autochk /k:D * /m \??\D:"
  • Avoid fsutil dirty set - Doesn't specify scan parameters
  • Don't omit chkntfs /x - May trigger automatic quick check instead
  • Administrator privileges required

Batch script to schedule and notify:

@echo off
setlocal
set DRIVE=D:

chkntfs /x %DRIVE%
chkdsk %DRIVE% /f /r
if %errorlevel% equ 0 (
    echo Scheduled surface scan for %DRIVE% on next boot
    fsutil dirty query %DRIVE%
) else (
    echo Scheduling failed. Run as Administrator?
)
endlocal