yossikally
asked on
How can I get CPU temperature in code
Windows Measurements Instrumentation interface contain a method to get CPU temperature but from what I have read, it is not implemented for most motherboards.
Still, lots of products e.g. Sisoftware,MotherBoard monitor ,PC Wizard 2008 offer this service. How do they get this data? Is it possible to inquire with the BIOS? Is it Kernel Mode funcitonality?
Any input - most welcome
Still, lots of products e.g. Sisoftware,MotherBoard monitor ,PC Wizard 2008 offer this service. How do they get this data? Is it possible to inquire with the BIOS? Is it Kernel Mode funcitonality?
Any input - most welcome
Sorry, forgot the link:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2226342&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2226342&SiteID=1
Usually a vendor-specific driver reads that data and reports it, yet the driver interface might not be documented. One common way would be WMI, but that might not always work. Could you try
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
Set wbemObjectSet = objWMIService.ExecQuery ("SELECT * FROM MSAcpi_ThermalZoneTemperat ure")
For Each wbemObject In wbemObjectSet
wscript.echo "------------------------- ---------- "
wscript.echo "MSAcpi_ThermalZoneTempera ture instance"
wscript.echo "------------------------- ---------- "
wscript.echo wbemObject.CurrentTemperat ure
Next
to see whether that works?
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
Set wbemObjectSet = objWMIService.ExecQuery ("SELECT * FROM MSAcpi_ThermalZoneTemperat
For Each wbemObject In wbemObjectSet
wscript.echo "-------------------------
wscript.echo "MSAcpi_ThermalZoneTempera
wscript.echo "-------------------------
wscript.echo wbemObject.CurrentTemperat
Next
to see whether that works?
ASKER
jkr, is there a C++ version of the aboe code?
Well, sure, but that would be futile unless the VBS thing works...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is probably the right solution, the only problem is that I cannot get it to run on my PC/XP, where I keep getting error 0x80041014 after the line
hRes = pEnumObject->Next(WBEM_INF INITE,uCou nt, &pClassObject, &uReturned);
executes
to which there is no clear cut solution
hRes = pEnumObject->Next(WBEM_INF
executes
to which there is no clear cut solution
jkr: did you copy this code from another website?
Open in new window