Delphi WMI Example
Posted on 2010-01-08
First time WMI user here, go easy.
I need to access the Win32_PerfFormattedData_PerfDisk_PhysicalDisk "database"(?) to get real time info on disk I/O events.
Locator := CoSWbemLocator.Create;
Service := Locator.ConnectServer('','root\cimv2','','','','',0,nil);
Output := Service.ExecQuery('SELECT * FROM Win32_PerfFormattedData_PerfDisk_PhysicalDisk','WQL',wbemFlagReturnImmediately,nil);
Enum := Output._NewEnum as IEnumVariant;
I get about this far before I go *^*&*(#@* what now. I've seen examples in every language except delphi and I'm not sure exactly how to traverse the results here. Any help?