A cause example:
In my case, Check-disk (at boot) is (re)produced from a "bad" misconfigurated custom shutdown batch|command, which (accidentally) makes the system thinks the shutdown was "Unexpected" (not normaly shutted) and sets the disk-check . - IF the "dirty" disk is the windows disk(C:) must be dismounted first - but, as the disk is in use by the system, sets an auto chkdsk at the next boot.
Cause more explanation:
I have set a "Run-on-idle-time" 'scheduled task' which after (1hour) pointed idle time expiration, triggers a custom HurryCleanNShutDown.bat
|cmd program. So, the program eg. starts the 'cleans', waits to finish and then shuts down (forced) the Computer.
Even if I tried many shutdown switch(es) (/d
) combinations (SHUTDOWN.exe /s /t 60 /f /d p:0:0 /c "PC shutting down... (in 1 minute)"
or even with chkNTFS /x c:
) the computer keeps giving the same problem Only IF Shutting Down triggered by this batch|program.
Note that if any third program could not use proper shutdown command syntax could reason this false chkDSK error.
Use of ShutDown: (shutdown /?
)
- If shutdown
is not accompanied by the required /d
'switch' with the p|u:xx:yy
'reason code', then the system considers this 'Shutdown'shutdown /s
(or 'Reboot'shutdown /r
) as "Unexpected" (not normaly shutted).
- If the above happens, the system points|flags the disc as "dirty" (bit) in the registry and promts for disk-check or (if it's current System's drive[C:] in use), sets an auto chkdsk (chkDSK C: /f ... /x
) at the next boot (because System drive must dismount first).
- After successful "chkDSK" the System will return to normal chkNTFS /d
---> [RegEdit: BootExecute value data: "autocheck autochk *"].
Fixes:
Suggested to use the "Command Prompt" (run as admin) instead of "Registry Editor".
It is much easier to use chkNTFS
command which automatically changes the
---> "BootExecute REG_MULTI_SZ" data value. (examples following below)
Also, if computer do not boot,
chkDSK and chkNTFS commands can be run from Recovery Console too.
/!\ Warning: command 'switches' differs a bit when you run from Recovery.
Tip: chkntfs /?
| chkdsk /?
to saw the use of.
- How to Check if a disk is pointed as "dirty":
fsutil dirty query c:
("c:" is disk letter)
- How to Forced Check Disk on (E:) disk:
chkNTFS /c E:
("E:" is disk letter)
---> [RegEdit: BootExecute value data: "autocheck autochk /m ??\E:"]
- How to Cancel Check on next boot:
(Excludes a drive from the default boot-time check.)
chkNTFS /x c:
("c:" is disk letter)
---> [RegEdit: BootExecute value data: "autocheck autochk /k:C"]
- How to Restore Defaults: (Restores the machine to the default behavior:
all drives are checked at boot time and chkdsk is run on those that are
dirty.)
chkNTFS /d
---> [RegEdit: BootExecute value data: "autocheck autochk *"]
(i) Registry key address:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\BootExecute
]
BootExecute REG_MULTI_SZ (multi-string value).
Here is almost everything about: by Richard John Eaton
https://social.msdn.microsoft.com/Forums/en-US/.../force-autochk-at-every-boot-up