someone said:
That's an idea, but where do I place the bat (or CMD?) file and where does
the command line go to execute it before GUI?
BTW, don't want to do this every time but occasionally, especially for
surface scan feature.
From the onset it should be noted that the startup disk check tool is
Autochk.exe, this native NT application is designed to check the disk
without the support of the Win32 subsystem, otherwise it does the same
thing as Chkdsk. There are two ways to have Chkdsk run when the
computer starts, Autochk will run if you schedule it to run or by
default it will run if the volume's dirty bit is set. If the operating
system detects problems it will automatically set the dirty bit and the
volume will be checked at the next startup. The dirty bit can also be
set manually but it is best not to do this and to leave the setting of
the dirty bit to the operating system because once set the dirty bit
cannot be changed and while the boot time check can be skipped it cannot
be canceled. On the other hand, a scheduled Chkdsk without the dirty
bit can be canceled at any time.
If you still want to use the "dirty bit" method just create a batch file
that will use the fsutil command to set the dirty bit on the volumes,
use a line for each of the volumes, for example to set the dirty bit on
volumes C, E, F & G:
====================================
fsutil dirty set C:
fsutil dirty set E:
fsutil dirty set F:
fsutil dirty set G:
====================================
Anytime you run the batch file the dirty bit will be set and chkdsk will
run against the volumes when Windows is rebooted. As noted earlier,
once set the dirty bit cannot be removed and while you can skip the
chkdsk it cannot be canceled, you have to let ckkdsk run to remove the
dirty bit.
Manually scheduled Check Disks are recorded at the BootExecute value at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
These schedule disk checks can be canceled by simply returning the
BootExecute value to its default value, this can be done with the
Chkntfs command:
chkntfs /d
To manually schedule a Chkdsk at the next reboot:
First run the chkntfs /d command to set the BootExecute value to its
defaults, then:
On the Windows volume, assumes the volume is C:
At the command prompt issue:
chkdsk c: /f
Chkdsk will return a message telling you that it cannot lock or dismount
the volume and ask you if you want to schedule a Chkdsk at the next
restart, answer Yes.
For dismountable data volumes, for example, volume D:
Open a file on the volume, or explore the volume with Explorer. Then at
the Command prompt issue:
chkdsk d: /f
Chkdsk will inform you that the volume is being used by another process
and it will ask you if you want to force a dismount on the volume,
answer No. Chkdsk will then ask you if you want to schedule a Chkdsk at
the next restart, answer Yes.
Do the same for the other drives that you want checked at boot time,
open a file on the volume and run the chkdsk command against the volume
and have it schedule a boot time disk check.
Now the drives are scheduled to run at the next restart. To do this in
a semi-automated manner, after doing the above:
Using Regedit export the
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager] key.
This exported file will be fairly large, edit the saved file and
remove/delete everything except the BootExecute value, the edited file
will look like this:
==========================================================
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,
......... with a long series of numbers.
=====================================================
(Leave a blank line at the end of the file.) You only want to save the
BootExecute value, nothing else!
Save the edited .reg file and when you want to schedule the Chkdsk merge
it to the registry.
To reset the BootExecute value and cancel all scheduled Chkdsk at the
command prompt issue:
chkntfs /d
John