Skip to main content

 none
Problem with getting cpu, hdd temperature and fan speed RRS feed

  • Question

  • I'm writing a script that gets cpu, hdd temperature and fan speed.

    I tried to use WMI classes Win32_Fan, Win32_TemperatureProbe, but failed to get instances of the classes.

    Is there another way to get required data or make these classes work?

    • Moved by Mike Dos Zhang Tuesday, September 25, 2012 3:02 AM get hardware state info (From:General Windows Desktop Development Issues)
    Friday, September 14, 2012 7:26 AM

Answers

  • not appropriate for the wdk  forum.  this isn't about driver developement, rather about what bios exposes in acpi and what drivers the bios vendor writes to expose that information. contact your mobo bios vendor.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, September 25, 2012 5:55 AM

All replies

  • http://www.scriptinternals.com/new/us/support/Internal/WMI_Win32_Fan.htm

    This script will give you what you wanted.

    And for the script problem, you can use this forum: http://social.technet.microsoft.com/Forums/en/ITCG/threads/

     

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Monday, September 17, 2012 2:37 AM
  • Thank you for reply, but the problem is not in the code,

    the class Win32_Fan has no instances.

    I got hdd temperature using MSStorageDriver_ATAPISmartData, but I also need to get

    cpu, gpu and motherboard temperature and fan speed.

    There are other classes such as Cim_Fan, Cim_Tachometer, Cim_Sensor

    related to the issue which also have no instances.

    It would be great if somebody could point out an alternative to these classes.





    • Edited by Arus_h Monday, September 17, 2012 9:24 PM
    Monday, September 17, 2012 8:31 PM
  • The GetObject function is helping you to get the WMI class instance, it is the solution to make it work.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us


    Tuesday, September 18, 2012 2:11 AM
  • Sorry, but the result is just the same.

    I can get all the properties with third party programs (e.g. Everest), but cannot find scripting solution.

    Tuesday, September 18, 2012 7:19 AM
  • But I can run this vbs and get the values:

    strServer = "."
    
    Set objWMI = GetObject("winmgmts://" & strServer & "/root\cimv2")
    Set objInstances = objWMI.InstancesOf("Win32_Fan",48)
    
    For Each objInstance in objInstances
       WScript.Echo objInstance.getObjectText_
    Next
    form the link in my first post.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, September 18, 2012 8:04 AM
  • It doesn't work on my computer. Nothing to do with fans or temperatures work on my computer. I always assumed that the computer manufacturer needs to supply the data provider.

    --
    .
    --
    "Mike Dos Zhang" wrote in message news:76640651-9e60-4b48-8f14-dc18c22b5e37...

    But I can run this vbs and get the values:

    strServer = "."
    
    Set objWMI = GetObject("winmgmts://" & strServer & "/root\cimv2")
    Set objInstances = objWMI.InstancesOf("Win32_Fan",48)
    
    For Each objInstance in objInstances
       WScript.Echo objInstance.getObjectText_
    Next
    form the link in my first post.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, September 18, 2012 8:19 AM
  • I tested this code on three computers, both desktop computers and laptop,

    It can't get instances.

    They say not all computers support this class.

    Tuesday, September 18, 2012 8:28 AM
  • Maybe the problem like David said.

    Or maybe the problem is the driver.

    Have you checked if you can query it from the WMI tool in your computer? 


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, September 18, 2012 8:40 AM
  • I've heard Asus motherboards (I have Gigabyte) support it. Look on the manufacturer's web site for drivers that support WMI.

    --
    .
    --
    "Arus_h" wrote in message news:77e28096-4c31-4737-bf5f-150dd645c79a...

    I tested this code on three computers, both desktop computers and laptop,

    It can't get instances.

    They say not all computers support this class.

    Tuesday, September 18, 2012 8:42 AM
  • Thank you for reply, but I'm looking for a generic solution of the problem.
    Tuesday, September 18, 2012 8:59 AM
  • I just want to know if the WMI query statement can work under WMI tool on your computer, maybe it really cannot work for you if it also cannot work under WMI tool on your computer.

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, September 18, 2012 9:05 AM
  • I understand you need a generic solution. I found a chipset by chipset solution but you would need to become an expert in EVERY chipset used (and wouldn't work in the future).
     
    Another way to test, in addition to Mike's suggestion, is use the command line.
     
    wmic PATH Win32_TemperatureProbe get /format:List
    wmic PATH Win32_Fan get /format:List
     
    See this from Vista's PSDK.
     

    Win32_TemperatureProbe

    The Win32_TemperatureProbe WMI class represents the properties of a temperature sensor (electronic thermometer).

    Most of the information that the Win32_TemperatureProbe WMI class provides comes from SMBIOS. Real-time readings for the CurrentReading property cannot be extracted from SMBIOS tables. For this reason, current implementations of WMI do not populate the CurrentReading property. The CurrentReading property's presence is reserved for future use.


    --
    .
    --
    "Mike Dos Zhang" wrote in message news:cdb39a99-f32c-40d6-86b0-d1392b005a20...
    I just want to know if the WMI query statement can work under WMI tool on your computer, maybe it really cannot work for you if it also cannot work under WMI tool on your computer.

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, September 18, 2012 9:26 AM
  • I used WBEMTest utility from WMI Administrative Tools to query Win32_Fan instances,

    but there was no result. The same with wmic. 

    Anyway thanks for reply.

     
    • Edited by Arus_h Tuesday, September 18, 2012 12:28 PM
    Tuesday, September 18, 2012 9:48 AM
  • Maybe it is real the hardware driver does not support this WMI query problem.

    But I suggest you go to the WDK forum, it is for talking about hardware related dev, so I think they maybe can give you some help on programming retrieve info from hardware.

    If there's any concern, please feel free to let me know.

    Best wishes,


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Thursday, September 20, 2012 2:17 AM
  • not appropriate for the wdk  forum.  this isn't about driver developement, rather about what bios exposes in acpi and what drivers the bios vendor writes to expose that information. contact your mobo bios vendor.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, September 25, 2012 5:55 AM