Conditionally Organizing Files into Dedicated Folders

I have a workflow that has an ingest stage and then an organize stage. I would like to automate the organize stage.

I'm hoping to run a script and move files to their intended (hard-coded) target.


In a single ingest folder there might be:

  • kangaroo 19.12.01 hopping
  • kangaroo 19.12.05 sitting
  • gorilla 19.06.23 hanging
  • gorilla 19.08.15 sleeping

I want the script to have hard-coding that moves these files into their intended folders, (Keying off gorilla and kangaroo in this example)

The end result would be:

  • C:\Apes\Gorilla\gorilla 19.06.23 hanging
  • C:\Apes\Gorilla\gorilla 19.08.15 sleeping
  • C:\Marsupial\Kangaroo\kangaroo 19.12.01 hopping
  • C:\Marsupial\Kangaroo\kangaroo 19.12.05 sitting

Also if the folders don't exist I want it to create it in it's target.
(If C:\Apes\Gorilla\ doesn't exist -- create it for example)

If files don't match the hard coding -- they should be left in place.

Can someone get me on the right track? I searched for this but couldn't find anything close enough for my script skills.

I don't think you'll need a script, a couple of commands should be enough. Or did I miss any requirement?

Copy MOVE HERE FILE="kangaroo*.*" CREATEFOLDER="C:\Marsupial\Kangaroo"
Copy MOVE HERE FILE="gorilla*.*" CREATEFOLDER="C:\Apes\Gorilla"

I don't think so but i need it in a script because I'm going to have hundreds of possible conditions.

This looks super promising. 2 questions:

  1. Can I just make a zillion lines with the conditions one below the other?
  2. If the destination directory already exists it won't cause an error will it?
  1. Yes
  2. No, it won't

Just did some testing and WOW. So simple and so powerful.

This is going to save me hours and hours of time every year and improve accuracy in my workflow.

Thank you!!!