Assigning Directories for "-Directory" Tag and Renaming Duplicates

Started by jphare, October 15, 2011, 12:04:34 AM

Previous topic - Next topic

jphare

OK, I have searched for an answer, but the solution is not obvious to me.  I'm having trouble with the proper syntax for the -Directory tag.

In short, I am trying to create a batch file (in Windows) that periodically moves files in a cache directory full of jpegs into directories based on their camera models.

Example:

Original files location:
c:\project\cache (full of jpegs)

Desired file locations
c:\project\archive\(model-1)
c:\project\archive\(model-2)
        .
        .
        .
c:\project\archive\(model-n)

When I use:

         exiftool "-Directory<Model"  c:\project\cache

as expected, a hieracrhy is made in c:\project.

However, I am trying to avoid a copy step and get the hierarchy to be directly created in c:\project\archive

I also would like the file names to increment if a duplicate file name is encountered during the move to the archive.

If this question seems basic, I apologize in advance.  But the sytax for directory assignments is confusing me.

Phil Harvey

If you specify a relative directory name as you are doing, then the result depends on your current working directory.  For example, if you "cd c:\project\archive" before running your command, then the directories will be created inside the archive directory.

However, you can specify an absolute directory name so it doesn't matter where you run the command from:

exiftool "-directory<c:\project\archive\$model" c:\project\cache

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).