Jump to content

Recommended Posts

Posted

Hello,
I have a PC in my living room, it is used as a media hub on my home TV.

The computer is hidden in a 'closet' .... it happens to forget the computer turned on after using it and the wardrobe door is closed.
In these cases the danger is to leave it on and risk damaging it.

Is it possible to intercept the temperatures of the computer (CPU, motherboard) and turn it off at a certain heat threshold?

m.

Posted

Here what I could find :

#RequireAdmin

Opt("MustDeclareVars", 1)

Example()

Func Example()
  Local $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\wmi")
  Local $colItems = $objWMIService.ExecQuery('SELECT * FROM MSAcpi_ThermalZoneTemperature')
  If Not IsObj($colItems) Then Exit MsgBox(0, "", "Not an object")
  If Not $colItems.count Then Exit MsgBox(0, "", "Not found")
  For $oItem In $colItems
    ConsoleWrite ("InstanceName = " & $oItem.InstanceName & @TAB & _
      "CriticalTripPoint = " & $oItem.CriticalTripPoint/10-273.15 & " C" & @TAB & _
      "CurrentTemperature = " & $oItem.CurrentTemperature/10-273.15 & " C" & @CRLF)
  Next
EndFunc

 

Posted (edited)

Thank you Nine,
it seems that #RequireAdmin inhibits ConsoleWrite and exit my cicles (for, while)

I lowered my WIN10 UAC to bottom, is this related ?

m.

Edited by myspacee
Posted (edited)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...