Filename that includes -w % replacement

Started by StarGeek, December 15, 2021, 12:58:08 PM

Previous topic - Next topic

StarGeek

I have a file that includes a %##D sequence and that sequence is being treated as one of the -w (-TextOut) option replacements even though I'm passing a directory and not an individual filename.

As an example, a file named File %28D_7103.jpg, where the %28 was an URL encoded parenthesis ( from when it was downloaded.
C:\>exiftool -v3 "-Filename<${BaseName;s/\d+$//}.%e" Y:\!temp\bbb\PercentProblem
======== Y:/!temp/bbb/PercentProblem/File %28D_7103.jpg
Setting new values from Y:/!temp/bbb/PercentProblem/File %28D_7103.jpg
Writing File:FileName
'Y:/!temp/bbb/PercentProblem/File %28D_7103.jpg' --> 'File Y:/!temp/bbb/PercentProblem_.jpg'
Error creating directory File Y:
Warning = New file name not allowed in Windows (contains ':')
Warning: New file name not allowed in Windows (contains ':') - Y:/!temp/bbb/PercentProblem/File %28D_7103.jpg
    1 directories scanned
    0 image files updated
    1 files weren't updated due to errors


So even though I'm not passing the actual filename on the command line, the %28D is treated as a formatted %D.

This is probably pretty obscure and I can't think of an easy way to deal with this off hand.
"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

Phil Harvey

Interesting.  You can add s/%/%%/g to your expression to fix this.  I guess this is the thing to do any time a tag copied to the filename may contain a "%"

- 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 ($).