Skip to content

Instantly share code, notes, and snippets.

@davidruhmann
Created December 6, 2012 22:49
Show Gist options
  • Save davidruhmann/4229197 to your computer and use it in GitHub Desktop.
Save davidruhmann/4229197 to your computer and use it in GitHub Desktop.
[Batch] Log a message to a file and or the screen
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:Log <xLog> <xMessage> [xParrot] [xSession]
:: Append the message with a timestamp out to the specified log file and repeat
:: the message to the display if xParrot is set to 1.
if not "%~1"=="" if exist "%~1" echo.%Date% %Time% %~4: %~2 >> "%~1"
if /i "%~3"=="1" echo.%~2
goto :eof
:: by David Ruhmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment