I have several vbs scripts using WMI working. They are accessing \root\DCIM\SYSMAN and checking various things (These are provided by Dell OMCI).
I am trying to get temperature from my Dell Precision M6600 laptop. However the Dell numeric sensors in WMI do not work correctly. Therefore I am getting temperature from \root\WMI specifically MSAcpi_ThermalZoneTemperature.
However, unlike my other WMI scripts for this one i need to run as Administrator or Disable UAC (which is essentially running as admin) or i get an access denied error code. Do you guys have any suggestions on how to get this information out of WMI while not running as admin a better way to get temperature programmatically? Code below.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM MSAcpi_ThermalZoneTemperature WHERE InstanceName =
'ACPI\\ThermalZone\\THM__0'",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "MSAcpi_ThermalZoneTemperature instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "Active: " & objItem.Active
If isNull(objItem.ActiveTripPoint) Then
Wscript.Echo "ActiveTripPoint: "
Else
Wscript.Echo "ActiveTripPoint: " & Join(objItem.ActiveTripPoint, ",")
End If
Wscript.Echo "ActiveTripPointCount: " & objItem.ActiveTripPointCount
Wscript.Echo "CriticalTripPoint: " & objItem.CriticalTripPoint
Wscript.Echo "CurrentTemperature: " & objItem.CurrentTemperature
Wscript.Echo "InstanceName: " & objItem.InstanceName
Next