I am trying to use a batch file to compare times and dates of files. Here is what I tried so far:
Given--files in "testfolder" are a mix of files of dates from 1999 to the present.
FOR /R c:\testfolder %%F IN (*) DO @IF "%%~tF" GTR "04/14/1999 02:45 PM" ECHO "%%~tF" >>c:\test.txt
The results of this line, lists all the files to "test.txt".
If I try:
FOR /R c:\testfolder %%F IN (*) DO @IF "%%~tF" GTR "04/14/2013 02:45 PM" ECHO "%%~tF" >>c:\test.txt
...I would expect only files newer than 04/14/2013 02:45 PM, but what happens instead, is that all the files are again listed to "test.txt". It appears that the IF condition is being ignored. I do not receive any error message.
What do I need to get this to work as expected?
Edited by ray5450, 12 May 2013 - 12:22 PM.