How to batch create folders with users names

ntadmin101

Distinguished
Nov 13, 2009
2
0
18,510
0
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.


 
Thread starter Similar threads Forum Replies Date
David___Only Apps General Discussion 0
S Apps General Discussion 4
M Apps General Discussion 3
D Apps General Discussion 2
N Apps General Discussion 1
NoctisLionward Apps General Discussion 2
malavena Apps General Discussion 3
Tom Waller Apps General Discussion 2
P Apps General Discussion 1
S Apps General Discussion 4
A Apps General Discussion 13
Z Apps General Discussion 1
P Apps General Discussion 7
G Apps General Discussion 0
T Apps General Discussion 5
SHADOWSTRIKE1 Apps General Discussion 3
D Apps General Discussion 3
D Apps General Discussion 1
L Apps General Discussion 6
P Apps General Discussion 5

ASK THE COMMUNITY