Rename file to file modify date with conflict counter

Started by MJ2024, October 26, 2024, 11:38:25 AM

Previous topic - Next topic

MJ2024

Hello,

New here and trying to get to grips with ExifTool, so I hope this is the correct way to get some support.

I'm looking to rename all files JPG, DNG and MP4 using the following format d %Y_%m_%dT%H_%M_%S (Day,Month, Year, 'T', Hours, Minutes, Seconds) from the date and time in the file modified meta data.

I'm tied to learn how to do that in Windows command prompt and I have the below command:
exiftool -d %Y_%m_%dT%H_%M_%S.%%-c "-FileName<${FileModifyDate;DateFmt('%Y_%m_%dT%H_%M_%S')}.%e" -ext jpg -ext mp4 -ext dng .

This command is working but i'm getting below:
    1 files weren't updated due to errors
When trying to update a multiple files and one (in this case) is not being updated because it has the same date and time to the second as another file in the same folder. I was hoping the %%-c would help with that but it appears not or have I formed this wrong?

Again i've very very new to this and using the command prompt so not familiar at all but would appreciate some help.

Thanks for the help and support!

StarGeek

You are trying to manipulate the date twice. First, with the -d (-dateFormat) option, then again DateFmt helper function. This will cause an error with the second date format change as the date isn't in the proper format for the DateFmt helper function.

Try this. I used Testname so you can double check to make sure the rename is exactly how you want it. If it is correct, change Testname into Filename
exiftool -d %Y_%m_%dT%H_%M_%S.%%-c.%%e "-TestName<FileModifyDate" -ext jpg -ext mp4 -ext dng .
"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

MJ2024

Thank you @starGeek, that's a big help and i'm up and running after testing. Thanks again for the swift support