1

I'm trying to create a simple batch file to match up 2 directories of files to resolve some issues between the 2 sets. This would be very easy to do if I could match them between directories based upon the creation date and time (spanning about 5 years) I see when I look at the 2 directories in Explorer. But when I do a dir or forfiles, I get the same date for all the files and the time increases by a second or 2 for each file. I assume it's showing when each file was added to the Zip file that was sent to me. I've tried dir/TC, /TA, and /TW and the corresponding syntax for forfiles, but the only difference any of them make is to give me what seems to be the date/time stamp for when I extracted the files.

4
  • Check out Robocopy from Windows 7. Just type in Robocopy /? and it should be there by default. It's way more robust than trying to do something elaborate with batch script and date time substitutions with batch commands. Also, look into 7zip for finding the attributes of files within Zip files as it has command line syntax you can run from Windows. Just some quick suggestions. I recall doing something in batch before but it wasn't simple so let me know if you find a simple way of comparing file date attributes natively. . . Example: FOR %%A IN ("%srcdir%\%~1") DO IF NOT "%~2"=="%%~NXTA" Commented Oct 26, 2015 at 17:36
  • 1
    I figured out my problem - I'm dealing with TIFF files and Win7 Explorer recognizes them as such and is using the date stamp that's stored inside each TIFF rather than the file's date stamp. Sneaky background process tripped me up.
    – Gene T
    Commented Oct 27, 2015 at 16:27
  • Perhaps it's just the view options (or columns) you have configured in these particular folders to show from Windows Explorer that show extended attributes or metadata of the TIFF image files? Not sure if the column name of Date Modified are showing the wrong dates if the column name in Windows Explorer is named differently than that, but something else to check--sounds like metadata fields or something that's being looked at from Windows Explorer. Good catch regardless though. Commented Oct 27, 2015 at 16:49
  • That's exactly right. It was the metadata fields I needed, hence the problem.
    – Gene T
    Commented Oct 27, 2015 at 17:16

0

You must log in to answer this question.

Browse other questions tagged .