I've done some testing with that one IF line, and there is an issue there no matter what command I use when true.
I am wondering if the %dt% and %date% are incompatible data types. I believe %dt% is pulling from the file, because when I echo everything, I see it first set dt=File server, which are the first 2 values parsed out of the first line of flag.txt.
So, I've been digging to see how to get the date accessed of the file instead, or to convert a string to a date. At the beginning of this thread is a suggestion to use for /f "skip=5 tokens=1-5" %%i in ('dir /tw /a-d') do echo %%i %%m
, but where do I pass the file name?