Win32_LogicalDisk Class and the Chkdsk() function!

  • Thread starter Thread starter Matthias Pfeffer
  • Start date Start date
M

Matthias Pfeffer

hello!

i want to run a check disk in my program and i found the function chkdsk()
in the win32_logicaldisk class.
http://msdn.microsoft.com/library/d.../chkdsk_method_in_class_win32_logicaldisk.asp

it works fine, but i don't get the information back, that i want.

this are the reutrn paramters:
0 Success - chkdsk completed
1 Success - Locked and chkdsk scheduled on reboot
2 Failure - Unknown file system
3 Failure - Unknown error


the function says only if the chkdsk completed successfully or not. but not
if my media is broken! :/

is it possible to find out if the checked media is faulted?


th 4 help
 
chkdsk reports it's outcome to the event log when it is run. Query the
eventlogs for the app name and you should get a summary message.
 
Most of what this method does is contained in the inparameters to the
function. If one of those boolean values is specified and the method
returns something other than zero, there was an error trying to do one or
the other requested actions like "FixErrors" and I would think that you can
assume that the media is bad if a 3 Failure is returned by this function. I
don't have a bad disk to check this with however.
 
Back
Top