|
以下是我在本论坛里找的CPU温度检测代码
现在有个问题就是我想检测CPU温度达到60度或以上才发送文本
而不是按现在的脚本检测完温度就发送文本
请问要怎么改呢?
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
FileWriteLine($config & @ComputerName & ".txt", @YEAR&'-'&@MON&'-'&@MDAY&'-'&@HOUR&'点'&@MIN&'分'&@SEC&'秒' & " 温度:" & StringTrimLeft($temp,20) & "°C")
[ 本帖最后由 landays 于 2009-2-13 03:08 编辑 ] |
|