Image-ExifTool - Re: Batch write filename to iptc field ?

Posted on Wed Apr 9 15:25:11 2008 by exiftool in response to 7620 (See the whole thread of 37)
Re: Batch write filename to iptc field ?
Thanks for the tutorial. I admit this forum sucks, but it saves me having to host a forum myself. To insert special symbols like < and > you need to escape them in html (ie. "&lt;" and "&gt"), or place them within a <code> ... </code> block.

Here are your instructions reformatted a bit:

------------------------------------------------

ExifTool must be used from within a Windows XP Command Window (aka as a 'Command Prompt'). To open one: Click on 'Start', click on 'All Programs', click on 'Accessories' and then click on 'Command Prompt'.

This will open with the 'current directory (folder)' active, which can be changed using the 'cd' command, but that is not necessary if you fully specify the folders as shown in the examples below (ie the directories to be used for the program and the target image file are explicitly defined).

Note that the first string in each command (in double quotes), which specifies the program to be used (ie ExifTool), will be dependent upon the folder structure on the PC being used, and thus where 'ExifTool' is stored on the disk.

1. This will update the IPTC tag 'ObjectName' with the filename, including its extension, of the image file specified at the end of the command (ie in this case #_1.jpg):

"C:\Program Files\ExifTool_GUI\ExifTool" "-IPTC:ObjectName<filename" C:\Photos\testa\#_1.jpg"

------------------------------------------------

2. This will update the same tag as above in the same way, but will do it for all .jpg files in the target directory given as the last string (in double quotes) in the command (ie "C:\Photos\testa").

"C:\Program Files\ExifTool_GUI\ExifTool" "-IPTC:ObjectName<filename" -ext .jpg "C:\Photos\testa"

When ExifTool finishes, it will tell you if it has updated the file, or, if you have specified a complete directory, it will say it has scanned it and how many files it has updated. I believe you can tell ExifTool to scan sub-directories (which would involve a recursive execution of its code) by specifying the -r tag, but I have not used this and I do not therefore know how to use it. It is documented though.
Direct Responses: 7624 | Write a response