How do I run chkdsk on reboot?

Extending @Barakando's answer: to create a full disk check, you need to use the /f flag to CHKDSK, as it is documented here.

As such a check requires the disk to be detached (un-mounted), because it manipulates the low-level filesystem data structures on way, which is incompatible with its usage. It tries to detach the disk. If it can't be done, then the full disk check will happen on the next reboot.

This was yet more verbose on Win7, but in Win10 the verbosity was simply disabled by the Microsoft, because they love us all and don't want to make our life too complex.

Probably there is no way to make it more verbose. At least not a way what can be find by google. Possibly booting into a rescue system or live system, and then making the scan from the command line would work.

However, the scan results are logged and you can get the results with the command

get-winevent -FilterHashTable @{logname="Application"; id="1001"}| ?{$_.providername –match "wininit"} | fl timecreated, message

Or the text log with the command

get-winevent -FilterHashTable @{logname="Application"; id="1001"}| ?{$_.providername –match "wininit"} | fl timecreated, message | out-file Desktop\CHKDSKResults.txt

As written here.

There was a question a short while ago, Run Program Before Login Screen Appears, where I thought he meant specifically he wanted to run chkdsk on boot based on the picture, but he really wanted to run a different program.

Well, I answered specifically for chkdsk, and I thought some might find my solution to "How do you run chkdsk on every reboot?" interesting.

asked Jul 26, 2011 at 14:09

1

Basically if you just want to run chkdsk /f or maybe chkdsk /r on bootup every time, you can set it to run when you shut down rather than trying to make it work in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager.

Here is how:

Create a file C:\WINDOWS\system32\confirm.txt with JUST y in it.

Then create C:\WINDOWS\system32\Chkdsk_Reboot.bat with this code in it:

echo y > confirm.txt
chkdsk c: /f /x < confirm.txt

Now if you have XP Pro, or other Pro-level OS'es, open gpedit.msc>Computer Configuration>Windows Settings>Scripts>Shutdown, and add that Chkdsk_Reboot.bat as a shutdown script.

Next reboot you will run your chkdsk command.

I am not sure if this will work for XP home since it does not have gpedit.msc. You may be able to create this directory structure and add the batch file there but I am not sure if it will work since Home does not use Group Policy: C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Shutdown

How do I run chkdsk on reboot?

answered Jul 26, 2011 at 14:14

KCotreauKCotreau

25.5k5 gold badges46 silver badges72 bronze badges

5

chkdsk is already set to run on every boot.

Take a look at HKLM\SYSTEM\CurrentControlSet\Control\Session Manager and locate a multi-string (REG_MULTI_SZ) entry called BootExecute. The value "autocheck autochk *" says that chkdsk will run on boot, however you will not see it because it runs on background, searching for disk errors.

If chkdsk detects some disk problem, then you will see the blue screen with full disk scan.

Edit:

Autocheck option samples, according to here (section: "The Dirty bit vs the Registy "Autochk" entry"):

Sample command              Resulting registry entry 
==============              ========================
Chkdsk C: /F                Autocheck autochk /p \??\C: 
Chkdsk C:\mountpoint /F     Autocheck autochk /p \??\VOLUME{GUID} 
Chkntfs D: E: /X            Autocheck autochk /k:D /k:E * 
Chkntfs G: /C               Autocheck autochk /m \??\G: 

How do I run chkdsk on reboot?

Ƭᴇcʜιᴇ007

111k19 gold badges197 silver badges260 bronze badges

answered Jul 26, 2011 at 14:17

How do I run chkdsk on reboot?

DiogoDiogo

29.8k64 gold badges148 silver badges221 bronze badges

5

How do I run chkdsk on boot?

From My Computer.
Boot your computer..
Go to on My Computer (double-click on the icon).
Right-click on the hard disk you'd like to run the utility on..
Click Properties..
Click Tools..
At the Error-checking tab, select Check Now..
To run the utility in the read-only mode, simply click Start..

Does chkdsk scan require reboot?

If the drive partition is a boot partition, chkdsk automatically restarts the computer after it checks the drive. You can also use the chkntfs /c command to schedule the volume to be checked the next time the computer is restarted.

How do I check chkdsk results after rebooting?

In the left navigation pane, expand the Windows Logs folder and click Application. In the right Actions pane, click "Filter Current Log..." to launch its dialog box. Click OK. On the filtered list (middle section), scroll through entries at the time Chkdsk was run (or when Windows restarted).