As an administrator for a Windows network, scripting to automate tasks becomes more of a necessity. Here is a simple...
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
script for a batch file to append the current date to log files:
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set date=%%a-%%b-%%c)
REM This sets a variable %date% to the current date.
REM Just append %date% to the log (output) file name.
REM Use >logfile%date%.log to create a new log file or >>logfile%date%.log to append to the log file.