Renaming files adds dollar sign

Started by johnD, June 16, 2018, 03:06:56 PM

Previous topic - Next topic

johnD

I tried the following command in the Windows command line to rename my pictures according to the date/time at which the photo was taken:
exiftool.exe -fileOrder datetimeoriginal "-FileName<$%16f%+.4nC.%le" -r -P <PATH>
I've got filenames in the format Photography_2018_385.ext, and I want to rename them to Photography_2018_0001.ext, but the actual result is $Photography_2018_0001.ext - almost correct, but not completely.
I don't know exactly if this is a bug or if I'm missing something. This is, of course, not a big deal, but I still want to know how to change this behavior. Simply removing the dollar sign breaks the command and it doesn't work anymore at all (output:
Warning: No writable tags set from <PATH>
Warning: Invalid tag name '%16f%+.4nc.%le' - <PATH>

for all the pictures).
Thanks in advance for your help :)

EDIT: If you have a better solution for this problem, I would be happy as well.

StarGeek

Remove the dollar sign and change the less than sign to an equal sign.

exiftool.exe -fileOrder datetimeoriginal "-FileName=%16f%+.4nC.%le" -r -P <PATH>

Common Mistake #5c.  The less/greater than signs are used to copy tags.  The equal sign is used to assign static values which the file name variables (%f, %e, %c, %d) fall under.  I'm not sure of the actual interaction here since the dollar sign seems to be forcing a string interpretation of the rest of the command (see common mistake 5b) so it's sorta weird.
"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

johnD