Keeping extensions in renamed jpg and cr2 files

Started by pfischer, March 25, 2015, 05:03:35 PM

Previous topic - Next topic

pfischer

Dear forum,
I use exiftool for automatically rename my files in a certain directory with the prefix Remos1, followed by the data_time and copyright info provided in the exif data. Normally I have only jpg files in the folder but since a few days, I additionally save raw files in the same directory which have the extension .cr2. I would now make exiftool to rename also my raw files in the same way but to keep the extensions which are either .jpg or .cr2, My code for the batchfile I used so far is:
"C:\Program Files\Exiftool\exiftool.exe" "-FileName<Remos1_${CreateDate}_$Copyright.jpg" -d %%Y.%%m.%%d_%%H.%%M.%%S%%%%-c

I have tried the following codes:
"C:\Program Files\Exiftool\exiftool.exe" "-FileName<Remos1_${CreateDate}_$Copyright" -d %%Y.%%m.%%d_%%H.%%M.%%S%%%%-c -> Provides filenames without any extension
"C:\Program Files\Exiftool\exiftool.exe" "-FileName<Remos1_${CreateDate}_$Copyright.%e" -d %%Y.%%m.%%d_%%H.%%M.%%S%%%%-c -> does not work at all

I read in the manual but did not find a solution. May somebody give me a small tip. I am quite sure that it is easy but I simply do not get the way to do it.
Thanks a lot
Philipp

Hayo Baan

If the commands are run from a batch file, then changing %e to %%e probably does the trick. In windows batch files you need to use double %. (A remnant from the DOS era).
Hayo Baan – Photography
Web: www.hayobaan.nl

pfischer

 :) Great, that works perfect. Thanks a lot.
Philipp