Chkdsk - Do All Drives

J

John Schneider

Running XP Pro on a system with 2 large hard drives, with a total of 8
partitions.

I like to do a chkdsk and defrag on each drive every few weeks. It's a
real pain in the rear to go through all the steps:
1) My Computer
2) Right-click on C: drive
3) Select Properties
4) Select Tools tab
5) Click on Check Now and set to run at next boot.
Repeat steps 2 - 5 for D: drive
Repeat steps 2 - 5 for E: drive
and on, and on, and on.

There HAS to be a way to have chkdsk do all drives without having to go
through all these manual steps every time. Anyone know the trick?

Also, for the defrag, its another tedious manual process. Any way to
have all drives defragged?

Ideally, I'd love a way to have the chkdsk run on all drives, then the
defrag of all drives, and to be able to have all this run at the next
boot time whenever I need to.

Thanks for any tips!
John Schneider
 
K

Kelly

Notes for a batch file:

Yes, it can be done, but its not practical. Often a drive is locked, and
the /F switch cannot be used without dismounting the volume, or waiting
until the next reboot.

If user intervention is required to answer a prompt, then the BAT file or
script will pause, waiting for the user to enter a Y or N.

If you can live with this, then the following code, copied and pasted into a
Notepad file and saved with a VBS extension will accomplish what you want.

Set WshShell = WScript.CreateObject("WScript.Shell")

Dim fso, d, dc
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For Each d in dc
If d.DriveType = 2 Then
Return = WshShell.Run("chkdsk " & d & " /f", 1, TRUE)
End If
Next

Set WshShell = Nothing
 
J

John Schneider

I really do appreciate the response. I'm very familiar with VB and that
looks like a workable solution, but I was just thinking about another angle.

When you manually go through the steps I outlined below (manually
setting the chkdsk's for each drive to run at next boot), that process
is generating some kind of script or batch file that is executed at the
next boot. What I'd like to do is make a copy of that script/batch file
before I reboot. Then, in the future when I want to do a chkdsk on all
drives at next reboot, I can just copy that script/batch file back to
where its supposed to be. This will save a lot of time not having to
manually set each drive to run chkdsk upon rebooting.

I've tried looking around to see where this is stored, but can't find
it. Any idea where it might be?

Thanks!
 
G

Guest

Look at the following article:
(it was written for Win2k, but applies to XP as well)

http://support.microsoft.com/default.aspx?scid=kb;EN-US;218461

It mentions how to set registry keys that will cause a chkdsk to run on the
next boot. You should be able to either use a .reg file to set this, or some
other registry-setting tool (regini, reg, dtreg, winreg...)

|Running XP Pro on a system with 2 large hard drives, with a total of 8
|partitions.
|
|I like to do a chkdsk and defrag on each drive every few weeks. It's a
|real pain in the rear to go through all the steps:
|1) My Computer
|2) Right-click on C: drive
|3) Select Properties
|4) Select Tools tab
|5) Click on Check Now and set to run at next boot.
|Repeat steps 2 - 5 for D: drive
|Repeat steps 2 - 5 for E: drive
|and on, and on, and on.
|
|There HAS to be a way to have chkdsk do all drives without having to go
|through all these manual steps every time. Anyone know the trick?
|
|Also, for the defrag, its another tedious manual process. Any way to
|have all drives defragged?
|
|Ideally, I'd love a way to have the chkdsk run on all drives, then the
|defrag of all drives, and to be able to have all this run at the next
|boot time whenever I need to.
|
|Thanks for any tips!
|John Schneider
 
A

anonymous

typethe reg entries in notepad save as a ?.reg and then open the ?.reg and
voilla! When your'e tired of it put aminus sign at the front of each entry
and save it as -?.reg, then open it and the entries are history (you can
remove that too)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top