어떻게하면 cmd 쉘에서 CPU 온도를 얻을 수 있습니까?
다음을 시도하십시오.
배치 파일 (GetCpuTmp.cmd)
@echo off
for /f "skip=1 tokens=2 delims==" %%A in ('wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature /value') do set /a "HunDegCel=(%%~A*10)-27315"
echo %HunDegCel:~0,-2%.%HunDegCel:~-2% Degrees Celsius
출처 일괄 파일은 ° C에있는 CPU 온도를 얻고 가변으로 놓았다 ,에 의해 답변 데이비드 루만
예제 출력 :
> GetCpuTemp.cmd
73.05 Degrees Celsius
PowerShell 함수 (get-temperature.psm1)
function Get-Temperature {
$t = Get-WmiObject MSAcpi_ThermalZoneTemperature -Namespace "root/wmi"
$currentTempKelvin = $t.CurrentTemperature / 10
$currentTempCelsius = $currentTempKelvin - 273.15
$currentTempFahrenheit = (9/5) * $currentTempCelsius + 32
return $currentTempCelsius.ToString() + " C : " + $currentTempFahrenheit.ToString() + " F : " + $currentTempKelvin + "K"
}
# Save in your c:\users\yourName\Documents\WindowsPowerShell\modules\ directory
# in sub directory get-temperature as get-temperature.psm1
# You **must** run as Administrator.
# It will only work if your system & BIOS support it. If it doesn't work, I can't help you.
# Just type get-temperature in PowerShell and it will spit back the temp in Celsius, Farenheit and Kelvin.
출처 PowerShell을 사용하여 CPU 온도 얻기
예제 출력 :
> get-temperature
73.05 C : 163.49 F : 346.2K