How to set datetimeoriginal of a list of files to match first file on the list.

Started by blu28, April 11, 2021, 09:48:14 PM

Previous topic - Next topic

blu28

I have a tool that lets me make a context menu item that processes a list of selected files. In other words, I can build a command line but the command line will have the the full list of files. I want to set all of the selected files to end up with the datetimeoriginal matching the datetimeoriginal of the first file on the list:

exiftool arg1... f1 f2 f3 f4
Before running this f1 has datetimeoriginal set, after all four have datetime original set to the same value, the starting value from f1.

My problem is that from the example I can copy all the tags from the first to the rest by using tagsfromfile, but if I only want a subset it seems I need to get the first file separately somehow:

exiftool arg1... -tagsfromfile f1 argx... f2 f3 f4
with argx being some stuff to specify that I want datetimeoriginal.

Is there someother way to do this so I can put the files all together.

StarGeek

Is this list passed directly to exiftool or is it passed some other way?

In the first case, I would think that you would have to make a script or batch file.  Under windows, for example, you could have a batch file like this
exiftool -TagsFromFile %1 -DateTimeOriginal %*
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype