SET DEVICE1=%~1 SET SMARTCTL=C:\Program Files\smartmontools\bin\smartctl.exe SET res=0 FOR /F "usebackq tokens=10 delims= " %%i IN (`@"%SMARTCTL%" -A "%DEVICE1%" ^| find "Temperature_Celsius"`) DO ( SET res=%%i goto printtemp ) :printtemp echo %res%
SET res=1 FOR /F "usebackq tokens=3 delims= " %%i IN (`query session console ^| find "console"`) DO ( SET res=%%i goto printtemp ) :printtemp