Created
February 16, 2021 18:59
-
-
Save jaka/2df59394ee2626b1c5b173cca94c34bb to your computer and use it in GitHub Desktop.
Quick & dirty batch file for logging with digitemp.exe on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: | |
SET LOGDIR=logs | |
:: generate log filename | |
SET filedate=%DATE:~-4,4%_%DATE:~-7,2%_%DATE:~-10,2% | |
SET filetime=%TIME:~0,-3% | |
SET filetime=%filetime::=_% | |
SET filename=%LOGDIR%\%filedate%_%filetime%.log | |
IF EXIST %LOGDIR% GOTO checkexe | |
MKDIR "%LOGDIR%" && echo Created directory for log | |
:checkexe | |
IF EXIST digitemp.exe GOTO checkcfg | |
echo digitemp.exe is missing. | |
GOTO :EOF | |
:checkcfg | |
IF EXIST digitemp.cfg GOTO logging | |
echo digitemp.cfg is missing, run digitemp.exe -i to create a configuration file. | |
GOTO :EOF | |
:logging | |
echo Starting logging at %DATE% %TIME% to %filename% | |
:loop | |
digitemp.exe -a -q -o%D,%T,%C >>"%filename%" | |
GOTO loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment