You can use WMI with MSFT_Disk (HealthStatus)
or
VDS interfaces with VDS_DISK_PROP (VDS_HEALTH)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello experts,
Is there any way in vb.net (or C#) to get the system drive health?
My Samsung Magician shows drive health as Good: 94.2 TB written.
Can we get this data using .net? Mostly for m2 or sata drives.
What about getting the S.M.A.R.T status?
Thanks :)
You can use WMI with MSFT_Disk (HealthStatus)
or
VDS interfaces with VDS_DISK_PROP (VDS_HEALTH)
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
Thanks for the tip, I've found this:
Dim MyMClass As ManagementClass = New ManagementClass(".\ROOT\Microsoft\Windows\Storage:MSFT_Disk")
For Each MyMObject As ManagementObject In MyMClass.GetInstances()
MyMObject("HealthStatus").ToString > 0=OK 1=Warning 2=Error Else=UnknownNext
Next
Is this correct? Because I just need this data for the system / boot drive, nowhere specified that in the code.
Best :)