|
下面是获取CPU温度,当达到指定温度则回写信息,现在我的工作需要CPU和GPU
(显卡核心)的温度都要监视,达到要求值,就回写信息,
注:config要2个变量,一个设定CPU,一个是GPU
Dim $temp
$config=IniRead ("config.ini", "config", "存储路径", "")
$objWMIService = ObjGet("winmgmts:\\.\root\WMI")
$colItems = $objWMIService.ExecQuery("SELECT * FROM
MSAcpi_ThermalZoneTemperature")
$temp = ""
For $objItem in $colItems
$temp &= "CurrentTemperature: " & ($objItem.CurrentTemperature
- 2732) / 10 & ""
Next
If Number(StringTrimLeft($temp,20))>=60 Then
FileWriteLine(@ComputerName & ".txt",
@YEAR&'-'&@MON&'-'&@MDAY&'-'&@HOUR&'点 '&@MIN&'分'&@SEC&'秒' & " 温度
:" & StringTrimLeft($temp,20) & "°C")
EndIf |
|