Automated CHKDSK in Windows 7 with multiple drives using a .bat:

This is a quick and easy way to run chkdsk on multiple drives using a .bat file in Windows 7.
Open notepad ( Start > type > notepad ) and copy the code below into your notepad and save
the file as chkdsk_all.bat, or what ever title you choose.

echo y|chkdsk /f
chkdsk D: /x /f
chkdsk E: /x /f
REM chkdsk F: /x /f
REM chkdsk G: /x /f
REM chkdsk H: /x /f
REM chkdsk i: /x /f
REM chkdsk J: /x /f
REM chkdsk s: /x /f
shutdown -r -t 05

The above, as it sits right now, would check D: and E: in Windows, and then reboot your pc to check C:
REM tells the bat file to ignore that line, and of course change the drive letters as you need.
When you run it make sure to Right Click on it and choose "Run as administrator".
It might not work unless you Run as administrator.

Also, if you'd like to fix the wait time when your pc reboots and counts down to chkdsk C:
you can fix it in the registry with this.

Fix chkdsk timer:

Key: SYSTEM\CurrentControlSet\Control\Session Manager
Name: AutoChkTimeOut
Value: 0 secs - no countdown
Value: 1-259,200 secs - countdown

Navigate to the location and create a new DWORD (32bit) Value.
Name it as the name above and set a value you like. I have mine set for 5.

Of course, please make sure to either back up your registry, create a restore point or image your OS partition
before making any changes to the registry.

Return to PC Help Desk Main Page

Click for Contact