- @echo off
- set WMIC_CMD=wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature where "InstanceName like '%%CPUZ%%'" get CurrentTemperature /value
- for /f "tokens=2 delims==" %%i in ('%WMIC_CMD% ^| findstr "CurrentTemperature"') do (
- set "DegreeKelvin=%%i"
- )
- set /a "DegreeCelsius=(%DegreeKelvin%*10)-27315"
- set "DegreeCelsius=%DegreeCelsius:~0,-2%.%DegreeCelsius:~-2%"
- echo CPU: %DegreeCelsius%
- pause
复制代码
|