Batch Folder Creation Question

Discussion in 'The Digital Darkroom' started by mSummers, Jan 4, 2009.

  1. mSummers

    mSummers Member

    Is there a way to batch create multiple folders in multiple directories?

    Say for example I wanted to create a set of folders to file my WDW photos and wanted to make a folder for the Magic Kingdom and then create a folder inside of that for each land. Within the folder for each land, I'd want to create a folder for each of the attractions found in that land. Is that possible?

    It would take forever to create those by using the "right click, make new folder" method.
     
    Last edited by a moderator: Apr 11, 2014
  2. Roger

    Roger Member Staff Member

    I take it you mean Windows. Otherwise I could see using an Automator action to do this.
     
    Last edited by a moderator: Apr 11, 2014
  3. mSummers

    mSummers Member

    Yeah, I'm looking for how to do it in windows
     
  4. Roger

    Roger Member Staff Member

    Use command prompt mkdir and a batch file. Are you trying to do this just once or many times?
     
    Last edited by a moderator: Apr 11, 2014
  5. mSummers

    mSummers Member

    I'd use it more than once. I'd probably use it to create a fresh set of folders after each trip to file the raw images on my laptop before I edit them and transfer them to to the storage folders on my Drobo. I need to do the same thing for my Williamsburg Files as well.
     
    Last edited by a moderator: Apr 11, 2014
  6. Roger

    Roger Member Staff Member

    okay, well, once you know your starting directory, I'm guessing something like this would work:

    cmd
    cd c:\pictures\START
    mkdir MK DAK DHS EPCOT OTHER
    cd MK
    mkdir MainStreetUSA Tomorrowland Adventureland Castle Frontierland LibertySquare Fantasyland ToontownFair
    cd Tomorrowland
    mkdir BuzzLightyear TTA SpaceMountain IndySpeedway Stitch etc etc
    cd..


    And so on...that way you'd only have to change the beginning directory in the batch file.
     
  7. mSummers

    mSummers Member

    Thanks Roger. I'll give that a try.
     
    Last edited by a moderator: Apr 11, 2014
  8. Tim

    Tim Administrator Staff Member

    I just use the right click method. not elegant but it gets the job done.
     
  9. mSummers

    mSummers Member

    I usually do that, but I think it might be easier to write a batch file for this one.
     
  10. mSummers

    mSummers Member

    Roger, I couldn't get your script to work right. When I tried to add the next land, the cd command didn't work and I ended up with all of the attraction folders in one land's folder. Through a little trial and error, I got it to work correctly this way:

    mkdir "Walt Disney World"
    cd "Walt Disney World"

    mkdir "Magic Kingdom"\"Main Street USA"\"City Hall"
    mkdir "Magic Kingdom"\"Main Street USA"\Emporium
    mkdir "Magic Kingdom"\"Main Street USA"\"Casey's Corner"
    mkdir "Magic Kingdom"\"Main Street USA"\"Crystal Palace"
    mkdir "Magic Kingdom"\"Main Street USA"\"Exposition Hall"
    mkdir "Magic Kingdom"\"Main Street USA"\"Tony's Town Square"
    mkdir "Magic Kingdom"\"Main Street USA"\"Main Street Bakery"
    mkdir "Magic Kingdom"\"Main Street USA"\"Plazza Ice Cream Parlor"
    mkdir "Magic Kingdom"\"Main Street USA"\"The Plaza Restaurant"
    mkdir "Magic Kingdom"\"Main Street USA"\"Dapper Dans"
    mkdir "Magic Kingdom"\"Main Street USA"\"Toontown Tooners"
    mkdir "Magic Kingdom"\"Main Street USA"\Windows
    mkdir "Magic Kingdom"\"Main Street USA"\Other


    mkdir "Magic Kingdom"\Adventureland\"Swiss Family Treehouse"
    mkdir "Magic Kingdom"\Adventureland\"Magic Carpets of Aladin"
    mkdir "Magic Kingdom"\Adventureland\"Enchanted Tiki Room"

    etc etc

    Thanks for getting me started though. I was never good with DOS commands and didn't know the mkdir command.
     
    Last edited by a moderator: Apr 11, 2014
  11. Roger

    Roger Member Staff Member

    okay. It's been a while since I used command prompts, but supposedly you can use mkdir to make a whole bunch of directories within the same directory that you are in when you run it.

    Maybe XP changed it.
     
    Last edited by a moderator: Apr 11, 2014
  12. mSummers

    mSummers Member

    The mkdir worked fine to create the new directories they way you wrote it. The problem I ran into was that the cd command wouldn't move move laterally from one land to the other, so instead of creating the sub folders in Main Street and then backing up one level and moving to Adventureland, it stayed in Main Street and continued to create the sub folders for Adventureland in the folder for Main Street. There's probably a way to make it work, but like I said, I'm not that good with DOS.

    The way I made it work required some extra cut and paste, but it really didn't take that long to do. Once I figured it out, it only took about a half hour to type it all up. I've got all the attractions, restaurants, shops, parades and fireworks listed on the park maps and all of the resorts. The only thing I'm missing are the shops not listed on the maps.

    Thanks again for your help.
     
    Last edited by a moderator: Apr 11, 2014
  13. Grumpwurst

    Grumpwurst Member Staff Member

    When I worked with BAT files I had to add an extra step. For example:

    cd c:\SomeFolder
    c:

    To get it to move to that somefolder before executing the next code
     
    Last edited by a moderator: Apr 11, 2014
  14. mSummers

    mSummers Member

    Thanks Ray. I'll have to try that on the next one.
     
    Last edited by a moderator: Apr 11, 2014

Share This Page