Here's what I would do:
The problem is that the output for:
wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature
...results in an blank line at the end, which overrides the set command with the actual temperature.
To work around this, the output is directed to file, and then used to set the value.
even though the output file contains the blank line, SET will only read the first line of any file.
Console
IF EXIST "var_$CPU_TEMPERATURE.txt" del /q "var_$CPU_TEMPERATURE.txt"
for /F "skip=1 tokens=1 delims=" %P IN ('wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature') DO (echo %P>> var_$CPU_TEMPERATURE.txt) && (SET /P $CPU_TEMPERATURE= <var_$CPU_TEMPERATURE.txt)
echo %$CPU_TEMPERATURE%
Script
IF EXIST "var_$CPU_TEMPERATURE.txt" del /q "var_$CPU_TEMPERATURE.txt"
for /F "skip=1 tokens=1 delims=" %%P IN ('wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature') DO (echo %%P>> var_$CPU_TEMPERATURE.txt) && (SET /P $CPU_TEMPERATURE= <var_$CPU_TEMPERATURE.txt)
%echo $CPU_TEMPERATURE%