WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Reboot Issues

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Forces Drive Scan on Reboot


Question:

Does anyone know how to mark an NT drive as dirty so the drive will be scanned at reboot? I'd like to be able to do the equivalent of "chkdsk /f". (But of course this requires interaction at the DOS prompt.)

Answer:

You could try:
Run("cmd.exe", "/c echo y | chkdsk /f")

OR


The registry entries used by Autochk to determine which volumes get checked at boot time are: Hkey_local_machine\System\CurrentControlSet\Control\Session Manager\ BootExecute:REG_MULTI_SZ: autocheck autochk *

NOTE: This is the default setting for Autochk and also the result of using Chkntfs /d to have all volumes checked at boot time.

Additional entries that can be found in BootExecute are:

Registry value Function 
/P \??\Volume: Schedules an unconditional Chkdsk against the volume. 
/p \??\VOLUME{GUID} Schedules an unconditional Chkdsk against a volume mount point. 
/k:Volume * Excludes Chkdsk from running against the volume. 
/m \??\Volume: Tells Autochk to look only at the dirty bit on the volume, and if set, run Chkdsk. 

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: 
Reference: http://support.microsoft.com/?scid=218461
Article ID:   W16006
File Created: 2004:03:30:15:42:10
Last Updated: 2004:03:30:15:42:10