10
\$\begingroup\$

I'm still struggling with Exiftool's commands; even with, what should be (and probably is) a simple operation.

How to set the "date modified" by "date taken / original date" for all images in a folder, that is overwrite current "date modified" with the current "date taken"?

\$\endgroup\$
3
  • \$\begingroup\$ Just for clarity, can you run exiftool -time:all -a -G0:1 -s yourfile.jpg and give the exact "date modified" tag (and group) you want to change? \$\endgroup\$
    – mattdm
    Commented Sep 11, 2015 at 14:06
  • \$\begingroup\$ @mattdm - I imagine it would be [File:System] FileModifyDate. Additional question, if you know; what exactly are the circumstances in which FileAccessDate changes / or does not change? What is the practical usage of that file attribute? \$\endgroup\$
    – Rook
    Commented Sep 11, 2015 at 14:10
  • \$\begingroup\$ @ldigas, from what I read, under Windows XP, the FileAccessDate would change whenever the file was accessed in any way. This was turned off in versions from Vista onward to increase speed. It can be turned back on for those versions with a registry edit. Edit: Found link, Last Access Timestamp - Enable or Disable in Windows \$\endgroup\$
    – StarGeek
    Commented Sep 11, 2015 at 16:41

1 Answer 1

16
\$\begingroup\$

Assuming you're using Windows, part of the problem is that there is no "Date Taken" tag. Windows fills this property with different metadata, depending upon what it can find. The mostly likely tag is the EXIF:DateTimeOriginal tag. So the best command for you to try would be:

ExifTool "-FileModifyDate<EXIF:DateTimeOriginal" DIR

Edit: I made a more complete command. This will set the FileModifyDate by trying all the various metadata Windows uses for the "Date Taken" property. It uses the fact that when ExifTool has two assignments that affect the same tag, the latter takes precedence.

ExifTool "-FileModifyDate<XMP:DateTimeOriginal" \\
   "-FileModifyDate<EXIF:CreateDate" \\
   "-FileModifyDate<XMP:CreateDate" \\
   "-FileModifyDate<$IPTC:DateCreated $IPTC:TimeCreated" \\
   "-FileModifyDate<EXIF:DateTimeOriginal" DIR
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.