Batch file rename of JPG and MTS files to append date/time to file name

Started by Barry Small, July 07, 2018, 10:21:39 PM

Previous topic - Next topic

Barry Small

Can you please provide me with a batch file that I can use for any directory containing a selection of JPG and MTS files.  I wish to append to the start of each file name the date and time that the file was created.  I can then sort all files in the directory in a chronolgical order of date taken.  I will then be able to use these renamed files with any slideshow software.

Hope you can help.

Barry Small
New Zealand

Phil Harvey

Hi Barry,

Something like this may do what you want:

exiftool "-testname<${createdate;} ${filename}" -ext jpg -ext mts DIR

Here I used TestName so you can see what will happen before actually going ahead and renaming the files.  When you are happy with the names, change TestName to FileName in the command to actually rename the files.

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