Sign in with
Sign up | Sign in
Your question

How to batch create folders with users names

Last response: in Apps General Discussion
November 13, 2009 2:32:00 PM

In an earlier post How to batch create folders 1-x I showed how you can easily create a whole bunch of folders with numbers as the folder names using a batch file.

In this post I'll show you how to do this using usernames or some other data (provided that the data doesn't break the folder naming convention in Windows.)

Again we're going to use excel and create a batch file.

You should have an excel document with your users names in a single column In my example all of the user names will be populated in column B

  • Click into cell 1 of column A and type c:\folder\

  • Hit enter and you will be dropped down to the next cell.

  • -Single click on Cell 1 in Column A and notice the little black square at the bottom right of the cell

  • -Click and hold on that square and drag it down as far as you need, or to where the names end in the parallel Column B. You should now see that all the cells in column A have C:\folder\ in them

    Time to concatenate

    Hopefully column C is empty if not pick another column. My example uses Column C.
  • Click Cell A in column C then click into the formula bar and type
    CONCATENATE(A1 & B1) Then hit enter

    You should now see that cell A of column C has c:\folder\(username from Cell A of column B)
  • Click and hold on the little black box on Cell A Column C and drag down as far as you need to.

  • Highlight and copy column C's data.

    Now we create the batch file

  • Click start, run and type notepad
  • paste your data into the notepad document and then save it as MakeFolders.bat Windows will warn you about the file name change, just accept it.

    Before you run the new batch file, check the root of C to make sure you don't have a existing folder named "folder"

    That's pretty much it.

    Note:You can tweak the paths in the batch file as needed.

    I hope this helps somebody out.

    November 27, 2009 6:16:47 AM

    Thanks for sharing man! :)