Page 1 of 1

Rename picture and video files using EXIF and <datemedia>

Posted: 15 Feb 2023 15:39
by tomuser
I'm struggling to find proper command to batch rename currently selected picture and video files. So for example if picture has file name "DSC_001.JPG" and creation date from EXIF is "15.02.2023 16:34:22" then final name for file would be "15022023_163422_DSC_001.JPG"

For pictures I'd like to use either creation date or modified date from EXIF and for videos XYplorer's newest addition "<datemedia>" info for renaming them and maintaining their original name as well.

Re: Rename picture and video files using EXIF and <datemedia>

Posted: 15 Feb 2023 16:02
by RalphM
You could try a CFA as follows:

Code: Select all

|"Rename with EXIF date && filename" \;*>::rename b, '<dateexif ddmmyyyy_HHnnss>_*'

Re: Rename picture and video files using EXIF and <datemedia>

Posted: 15 Feb 2023 16:45
by tomuser
RalphM wrote: 15 Feb 2023 16:02 You could try a CFA as follows:

Code: Select all

|"Rename with EXIF date && filename" \;*>::rename b, '<dateexif ddmmyyyy_HHnnss>_*'
Just additional question: what do these parts do which I have marked with bold blue?

|"Rename with EXIF date && filename" \;*>::rename b, '<dateexif ddmmyyyy_HHnnss>_*'

I used only this last part as my script:

Code: Select all

rename b, '<dateexif yyyymmdd_HHnnss>_*', p
and seems to work well. I added also "p" for preview for safety.

Re: Rename picture and video files using EXIF and <datemedia>

Posted: 15 Feb 2023 23:17
by RalphM
These are part of the CFA syntax, so you should read up on CFA's in the help file
If you use just the rename command by itself in a script, it doesn't handle multi-selection whereas a CFA would.