How to batch backup filenames into tags?

Started by Marsu42, April 21, 2017, 01:19:07 AM

Previous topic - Next topic

Marsu42

I'd like to save the filenames of images into their metadata tags with one exiftool run, any hint how to do this?

This doesn't seem to work: exiftool -comment=%f *.jpg (or on Windows exiftool -comment=%%f *.jpg)

Thanks for any hints!

Phil Harvey

Try this:

exiftool "-comment<filename" DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Stephen Marsh

As I also use Adobe products, such as Bridge which features a batch rename tool, I use the same tag as Adobe.


Add/Copy filename to Adobe Preserve Original Filename metadata entry (removing the file extension):

exiftool -r '-XMP-xmpMM:PreservedFileName<${filename;s/\.[^.]*$//}' 'DIR or FILE'



Add/Copy filename to Adobe Preserve Original Filename metadata entry (including file extension):

exiftool -r '-XMP-xmpMM:PreservedFileName<${filename}' 'DIR or FILE'


Rename files using their preserved filename metadata entry:

exiftool -r '-FileName<XMP-xmpMM:PreservedFileName' 'FILE or DIR'