Hi
Here is a vbscript version that will run CHKDSK without using /F on all drives
and create a log file (if you add /F the script will just hang so you
shouldn't)...
'chkdsk_all.vbs
'Runs chkdsk on all hard disks - Can be run as a Scheduled Task
'puts the output of chkdsk in a log and display it
'© Torgeir Bakken - 2002-03-05
'Based on the script defrag_all2.vbs by Doug Knox
'This code may be freely distributed/modified
Option Explicit
Dim WshShell, fso, d, dc, LogFile, Drive
Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For Each d in DC
'Determine drive letter of first fixed disk
'This is the drive that the report will be placed on
If d.DriveType = 2 Then
Drive = d
Exit For
End If
Next
LogFile = Drive & "\chkdskreport.txt"
WshShell.Run "%comspec% /c echo Starting chkdsk of all hard disks " _
& Now & " >" & LogFile, 0, True
For Each d in dc
If d.DriveType = 2 Then
WshShell.Run "%comspec% /c echo ********* Checking drive " & d _
& " ******** >>" & LogFile, 0, True
WshShell.Run "%comspec% /c chkdsk.exe " & d & " >>" & LogFile, 0, True
End If
Next
WshShell.Run LogFile
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide:
http://www.microsoft.com/technet/scriptcenter