ExifTool Forum

ExifTool => Newbies => Topic started by: mallycat on August 05, 2012, 05:51:52 PM

Title: Reorder photos into date folders
Post by: mallycat on August 05, 2012, 05:51:52 PM
Hi, newbie here.  I am trying to reorganise my photos into a flat folder structure using dates.  ie 2012_06_01.  I have read the documentation and am using the following command (as a test first using 2 sample files).

c:\exif\exiftool "-Directory<DateTimeOriginal" -d %Y_%m_%d *.jpg

As far as I can tell, this is the correct syntax.  Trouble is it is moving the photos to a folder titled m_d instead of the actual date.  I have run the exiftool on the jpg files and I can confirm that the date/time original metadata is definitely in the file itself.

Can someone please help me know what I am doing wrong.
Title: Re: Reorder photos into date folders
Post by: StarGeek on August 05, 2012, 06:49:12 PM
I think you need quotes around the %Y_%m_%d part.
Title: Re: Reorder photos into date folders
Post by: mallycat on August 05, 2012, 07:01:06 PM
Thanks for the reply.  I have tried your suggestion as follows:

c:\exif\exiftool "-Directory<DateTimeOriginal" -d "%Y_%m_%d" *.jpg

but it didn't make any difference - same outcome.
Title: Re: Reorder photos into date folders
Post by: mallycat on August 05, 2012, 07:08:32 PM
mmmmm, on  a hunch, I tried something different.  Sorry, I did not mention in the original post, but I am using a batch file to execute this command.  When I put the command in a batch file, it doesn't work.  When I enter the exact same command on the command line it works.   Can somone help me understand why.
Title: Re: Reorder photos into date folders
Post by: mallycat on August 05, 2012, 07:11:18 PM
OK, now I know.  I searched the documentation to see if there was some special handling for batch files and found that there is.  Soi to complete the thread, this worked in a batch file

c:\exif\exiftool "-Directory<DateTimeOriginal" -d %%Y_%%m_%%d *.jpg
Title: Re: Reorder photos into date folders
Post by: Phil Harvey on August 06, 2012, 08:27:53 PM
Yup.  You fell prey to the newbie .BAT must-escape-the-percent-symbol trap!

- Phil