FileName<CreateDate in CMD does not work

Started by Jaa, December 30, 2015, 04:52:31 AM

Previous topic - Next topic

Jaa


Hi Phil, hi all.

I like to rename picture from different type and different camera's and made therefor a CMD (commandline) in W7.
I would like to rename to YYYYMMDD_hhmm_xxxx with its extention.
xxxx should be the last four char's before the "."(dot)
It tried first the date and time as given below.

CMD file :
@echo off
C:\Tmp\ExifsR\exiftool -r "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" C:\Tmp\ExifsR
pause

List ofdirectory before:
De volumenaam van station C is W7
Het volumenummer is 18EF-6AF0

Map van C:\Tmp\ExifsR

30-12-2015  10:23    <DIR>          .
30-12-2015  10:23    <DIR>          ..
28-12-2015  14:21         7.012.218 1F8007.JPG
28-12-2015  14:21        15.669.427 1N8069.JPG
28-12-2015  14:21         6.381.710 1P8085.JPG
28-12-2015  14:21         5.691.717 2F8006.JPG
28-12-2015  14:21        13.546.977 2N8071.JPG
28-12-2015  14:21         6.480.114 2P8086.JPG
28-12-2015  14:21         6.699.930 3F8001.JPG
28-12-2015  14:21        11.300.705 3N8073.JPG
28-12-2015  14:21         6.444.020 3P8087.JPG
30-12-2015  08:35               177 Andere naam.cmd
30-12-2015  10:24                 0 DIR.txt
30-12-2015  09:38           715.776 ExifTool by Phil Harvey.doc
22-12-2015  11:32         6.660.407 exiftool.exe
              13 bestand(en)       86.603.178 bytes
               2 map(pen)  24.049.229.824 bytes beschikbaar

CMD produce the following error:
Error: 'C:/Tmp/ExifsR/mHS.JPG' already exists - C:/Tmp/ExifsR/1N8069.JPG
Error: 'C:/Tmp/ExifsR/mHS.JPG' already exists - C:/Tmp/ExifsR/1P8085.JPG
Error: 'C:/Tmp/ExifsR/mHS.JPG' already exists - C:/Tmp/ExifsR/2F8006.JPG
Error: 'C:/Tmp/ExifsR/mHS.JPG' already exists - C:/Tmp/ExifsR/2N8071.JPG
Error: 'C:/Tmp/ExifsR/mHS.JPG' already exists - C:/Tmp/ExifsR/2P8086.JPG
Error: 'C:/Tmp/ExifsR/mHS.JPG' already exists - C:/Tmp/ExifsR/3F8001.JPG
Error: 'C:/Tmp/ExifsR/mHS.JPG' already exists - C:/Tmp/ExifsR/3N8073.JPG
Error: 'C:/Tmp/ExifsR/mHS.JPG' already exists - C:/Tmp/ExifsR/3P8087.JPG
    1 directories scanned
    1 image files updated
    8 files weren't updated due to errors

One file is renamed into :
mHS.JPG

After running the command in a DOS box it seems to work OK:
C:\Tmp\ExifsR>C:\Tmp\ExifsR\exiftool -r "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" C:\Tmp\ExifsR
    1 directories scanned
    9 image files updated

C:\Tmp\ExifsR>

So, I guess this is a bug. Or do I something wrong?

Why an CMD ? Because first I want to modify picture to the right CreateDate, mostly if more camera's are use, to synchronise the pictures.
Is there someone who can help in this?


Michael

If sorting according to the create date is your only concern then why don't you use the appropriate sort option? Any DAM I know of can sort the pictures ascending/descending depending on the create date. And even explorer/finder can do so...

Just my 5 cents...
Michael

Jaa

Dear Michael,

Can you give me an manual how to sort all pictures from an event made with different camera's were date/time in the camera are not set correct?
I like every easy way.
Thanks in effort.

Jan

Phil Harvey

In a .BAT file the "%" character is special, so you must escape all "%" in the exiftool command by using "%%" instead.

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

Jaa

Thanks Phil,

You are right and I did that. Almost, I forgot one % behind the dot. (3 instead of 4)
Now I can go on with testing.

New script:
@echo off
cls
C:\Tmp\ExifsR\exiftool -r "-FileName<CreateDate" -d "%%Y%%m%%d_%%H%%M%%S.%%%%e" C:\Tmp\ExifsR
pause

Michael

Quote from: Jaa on December 30, 2015, 10:52:07 AM
Dear Michael,

Can you give me an manual how to sort all pictures from an event made with different camera's were date/time in the camera are not set correct?
I like every easy way.
Thanks in effort.

Jan

Jan, I sent you a pm.
Michael