Rename photos to sub-directory based on year and month

I want organize a bunch of old photos that are currently altogether in a single directory. After the rename, I would like them to be moved to

yyyy
	yyyy-MM
		{datetaken|D#yyyy-MM-dd} {modified|T#HH-mm-ss}.{ext}

For instance, a file named DSC_5162.JPG that was shot on 5/3/2019 at 16:57:36 would be moved to

2019
	2019-05
		2019-05-03 16-57-36.JPG

Is this possible using rename or is a script required? The filename pattern i want is {datetaken|D#yyyy-MM-dd} {modified|T#HH-mm-ss}.{ext} , but I don't know how to create the subdirectory structure.

NVM, I think I got it

{datetaken|D#yyyy}\{datetaken|D#yyyy-MM}\{datetaken|D#yyyy-MM-dd} {modified|T#HH-mm-ss}.{ext}
1 Like

This technique is very useful. I tried to modify to include the original filename, without extension, as a suffix but can't work out the correct syntax. New name settings with and without |noext produce exactly the same result, as shown.

{datetaken|D#yyyy}\{datetaken|D#MM}\{datetaken|D#yyyy-MM-dd} {modified|T#HH-mm-ss} ({name})

{datetaken|D#yyyy}\{datetaken|D#MM}\{datetaken|D#yyyy-MM-dd} {modified|T#HH-mm-ss} ({name|noext})

image
How do I get rid of the extension?

What you have on the 2nd line seems to work as-is:

This is what I see...

1 Like

Trying with 12.19.5, I see the same thing as you.

I think there may be a difference between the current beta and the code I'm using, but not sure yet. We'll investigate.

1 Like

This will work in the next update.