4

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"?

marked as duplicate by mattdm, inkista, MikeW, NickM, John Cavan Sep 13 '15 at 21:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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? – mattdm Sep 11 '15 at 14:06
  • @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? – Rook Sep 11 '15 at 14:10
  • @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 – StarGeek Sep 11 '15 at 16:41
9

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 (and the one Windows gives highest priority to) 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, in order of priority. It uses the fact that when ExifTool has two assignments that affect the same tag, the latter takes precedence. From what I've discovered, the XMP:DateTimeOriginal has the least priority, so it's used first, while the EXIF:DateTimeOriginal has the highest priority, so it's used last.

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

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