If this site goes down it is because of the crappy DreamHost web hosting: They will disable your "unlimited traffic" web server if a single bot hammers the site with a moderate load.  If necessary, an alternate ExifTool forum page is available at

Main Menu

-IF file has data in tag data processes it

Started by nyxtyr, March 27, 2021, 12:28:06 AM

Previous topic - Next topic


Working on a script to clear specific tags from files and want to loop it but I ran in to a problem where it keeps processing the files already processed. Below is what I have so far and it's working perfect with the exception it keeps processing files that don't have any data in the comment or title tags. I am trying to do something like "-if comment or title has data process it if not move to the next file"

C:\Users\encoder\Desktop\test\exiftool.exe -comment""= -title""= C:\Users\encoder\Desktop\test\* -r -ext mp4 -overwrite_original
timeout /t 60
goto cleantime


exiftool.exe -r -ext mp4 -overwrite_original -if "$Comment or $Title" -comment= -title= C:\Users\encoder\Desktop\test\

If either the Comment or Title tag exists, then exiftool will clear both of them.  The asterisk at the end of the filepath is useless when you are using the -r (-recurse) option, see Common Mistake #2.
Troubleshooting hints:
* Did you read FAQ #3 and use the command listed there?
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.


Works like a charm. Tested a few times and working perfect so far.