WMI Disk temperature lazarus / 34-Windows ---------------------------------------------------------------------- pcurtis · 2022-01-22 16:26 Not quite sure where to ask this but How can I get the temperature of a hard drive using WMI? I can't get my head around all the VB / Powershell stuff on the net. Thanks. ---------------------------------------------------------------------- Jurassic Pork · 2022-01-23 07:08 hello, you can try my modified wmi utility utilwmi to use the MSStorageDriver_ATAPISmartData wmi class you must change the wmi name space to root\WMI : in utilwmi : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i objWMIService   := FSWbemLocator.ConnectServer('localhost', 'root\WMI', '', ''); the class MSStorageDriver_ATAPISmartData doesn't work for all disk drive and as the temperature is a vendorspecific property the index can change according to manufacturer. Here is a code to read the temperature from my WD hard disk  (you must execute application as administrator ) : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button10Click(Sender: TObject);  var WMIResult         : TFPObjectList;      f                 : integer;      retVal          : String;      temperature       : String;  begin    WMIResult := GetWMIInfo('MSStorageDriver_ATAPISmartData', ['InstanceName','VendorSpecific']);    for f := 0 to Pred(WMIResult.Count) do    begin      retVal := TStringList(WMIResult[f]).ValueFromIndex[0];      Memo1.Lines.add(Retval);      retVal := TStringList(WMIResult[f]).ValueFromIndex[1];      temperature := retVal.Split(',')[163];      Memo1.Lines.add('temperature : ' + temperature + ' °C');    end;     WMIResult.Free;  end; Result in attachment Friendly, J.P ---------------------------------------------------------------------- pcurtis · 2022-01-23 12:02 OK. Thanks I got it to work. I have a Toshiba, the index is 199. Thanks.