Change created date, rename, and move in one operation?

Advanced Renamer forum
#1 : 22/06-20 05:26
Posts: 1
Hi, I love this software!

I have been using it to snuff out inconsistencies in my home video catalog about about 6,300 clips (I think I am compensating for having a grand total of 17 photos about seven minutes of video from when I was a kid).

I want to be able to update the created date to match the date and time the file was actually created, not when it was copied over to the disk, rename the file if necessary to match the creation date and time, and, as necessary, move the file to a new directory based on the new creation date.

When I try to use the move batch function, it uses the old creation date, so I have to handle the files in two passes.

Is there are way to accomplish all of this in one pass?

Thanks in advance!

22/06-20 05:26
#2 : 23/06-20 02:05
David Lee
David Lee
Posts: 746
Windows sets Date Created when a file is copied, as I think you have found out. The actual created date is normally saved in the timestamp Date Modified.

Otherwise, add a script method after you have changed the Created date and set item.newPath based on item.newCreatedDate

You need to be aware that item.newCreatedDate returns a date object in the format:
"Thu Jun 20 2019 08:47:56 GMT+0100 (GMT Daylight Time)"
so you will need to use JavaScript date methods to extract the parts of the date you require for the new folder name.

For example: to move to a new sub-folder in the same folder as the original file with name in the format "2019-06-20" use the script:

date = item.newCreatedDate;
folder = date.getFullYear()
+ '-' + ('0' + (date.getMonth() + 1)).slice(-2)
+ '-' + ('0' + date.getDate()).slice(-2);
item.newPath = item.path + folder + '\\';

Note that "\" has a special meaning so you must escape it in the string as "\\"

For information on date objects and methods see:

23/06-20 02:05 - edited 23/06-20 02:07