I've been working on a batch script to check filedates. I had it working yesterday morning, but for some reason, the variables that I set have started to be non-functional. Here is the code:
for /f %%a in ('dir /B/A:D') do (
for /f "tokens=1-3 delims=/ " %%b in ("%%~ta") do (
set FCMONTH=%%b
set FCDAY=%%c
set FCYEAR=%%d
echo %FCMONTH%\%FCDAY%\%FCYEAR%
)
)
Line-by-line:
- Find folders in the working directory
- Parse the file creation date into the first three tokens, assigned to %b, %c, and %d
- (through 5) Assign variables to the tokens
- (actually 6) Print out the result (debug I included that hasn't given me any new info)
When looking at the script results in cmd.exe, FCMONTH/DAY/YEAR are all being set correctly, but the echo is failing to read them:
Does anyone have any insights to my problem? I don't understand why it's failing to work all of a sudden.
Thanks