Thursday, December 18, 2003 10:39 AM
pdbartlett
More on FOR
I've just posted a comment to a CodeProject article on another usage of the FOR batch command, in addition to the one I mentioned previously. This time it's in building date/time-based file names, such as the example below which names a log file after today's date (assuming command extensions are enabled, and UK English date settings just to be awkward!):
FOR /F "tokens=1-3 delims=/ " %a IN ('DATE /T') DO SET FILENAME=Log%c%b%a.txt
I'll leave the time components as "an exercise to the reader" (if I've got one :)