Main Menu

Rename AND move to path\%Y

Started by RiversideKid, March 02, 2024, 03:51:40 PM

Previous topic - Next topic

RiversideKid

I have a command working which renames files to YYYYMMDD HHMMSS as follows:
exiftool -r -d "%Y%m%d %H%M%S%%-c.%%e" "-filename<CreateDate" "\\NAS\photo\1-New"

How would I use the -Directory command to move the renamed files to "\\NAS\photo\%Y" so that my 2024 files go into "\\NAS\photo\2024"

I realize that I am just not getting the syntax of the move command where I am combining it with a rename command but nothing I try is working.

Thank you in advance for any pointers!

Phil Harvey

This should do it:

exiftool -r -d "\\NAS\photo\%Y\%Y%m%d %H%M%S%%-c.%%e" "-filename<CreateDate" "\\NAS\photo\1-New"

(although the backslashes worry me a bit because they may be a special character in the quotes.  I would probably recommend using forward slashes instead.)

See this page for more details.

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

RiversideKid

THANK YOU! That worked like a charm!  Now I'm cooking with propane.
A few more %s and it's working as a batch file running as a scheduled task each night so when our phones automatically upload new pictures they auto-rename and auto-magically appear in the correct folder.
 ;D