Just trying to pull off some SMART info from connected Hard Drives on any computer my application will run on.
I’m using WMI for a lot of other stuff in the program, and every question about SMART I’ve looked at makes reference to Win32_DiskDrive. However, the data in here is really quite minimal and probably not SMART – I’m searching for information such as ‘Spin Retry Count’. Any ideas?
You are using the wrong class (you want MSStorageDriver_ATAPISmartData).
To change what attribute you want change
byte SpinRetryCount = 0x0A;to whatever value you wish (e.g. 0x02 for throughput performance)And remember that if you get anything other than 0, you need to buy a new hard drive!
Also this code requires UAC elevation, so you need to run the application as an administrator or you will get an exception.