Batch file 批处理文件是否可以检查pc中的温度是否过高?
我想通过批处理文件测试电脑的温度,可以吗?你能想出什么创造性的方法吗?是的,你能 您可以使用wmi获取系统中各个热区的温度Batch file 批处理文件是否可以检查pc中的温度是否过高?,batch-file,Batch File,我想通过批处理文件测试电脑的温度,可以吗?你能想出什么创造性的方法吗?是的,你能 您可以使用wmi获取系统中各个热区的温度 WMIC /namespace:\\root\WMI path MSAcpi_ThermalZoneTemperature Get CurrentTemperature,InstanceName 温度以分贝为单位返回 根据您的要求,您可能希望平均或获取最高温度读数,并对照限制进行检查 @echo off setlocal enabledelayedexpansion se
WMIC /namespace:\\root\WMI path MSAcpi_ThermalZoneTemperature Get CurrentTemperature,InstanceName
温度以分贝为单位返回
根据您的要求,您可能希望平均或获取最高温度读数,并对照限制进行检查
@echo off
setlocal enabledelayedexpansion
set maxtemp=0
FOR /F "skip=1" %%A IN ('WMIC /namespace:\\root\WMI path MSAcpi_ThermalZoneTemperature Get CurrentTemperature') DO (
if %%A gtr !maxtemp! set maxtemp=%%A
)
if !maxtemp! gtr 3500 echo its too darn hot in here
或者,根据您的要求,您可能需要平均温度。为什么不先告诉大家呢?第一个链接在这里:D第二个链接没有答案,第三个链接是2011年的…第四个或最后一个链接是block for me…wmic不包含在xp中。它包含在xp professional中,实际上是从microsoft免费下载的。