Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Multiple folders via EXCEL

Status
Not open for further replies.

smtss

Technical User
May 7, 2006
41
GB
I need an easy way of creating user folders to be used on a server, a know their is away using excel but can't remember how to do it.

I need to create the follwoing for example.
Server - basesrv
Main folder - homedir
department folder - 6JO
user folder - user1

I have 250 to do, can anyone help?
 
Home folders are created when you specify what it is in the User Account's Properties. You can select multiple accounts and specify \\servername\home\%username% on the Profile tab.

As far as your other folders, will each user have a unique folder? Why is one of them called 6JO? I'm not following you there.

If you have a list of usernames, and you wanted to create a bunch of folders based on that, you would just put your list of usernames in a text file and do a FOR loop, something like this:

for /F %1 in (users.txt) DO mkdir %1

That would create a folder that matches every user's name in the users.txt file in the current directory.

As far as using Excel, are you sure you're not mixing this up with something like CSVDE, the tool that automates creation of user accounts in AD using a CSV file?
 
OK, I didn't make myself clear enough, here goes.

I need to create multiple user folders inside a department folder.

What are the easiest ways of doing this?
 
As already stated, get your 250 folder names in a text file - lets call it users.txt, and format the text file like this:

user1
user2
user3

etc...

Then, create yourself a batch file that says:

for /F %1 in (users.txt) DO mkdir \\basesrv\homedir\6JO\%1

When run, this command will take each line of users.txt and replace %1 with each line. So as long as your users.txt file contains all of the required directories, the FOR command will create all of them.

--------------------------------------
"Insert funny comment in here!"
--------------------------------------
 
Humm.

When I talk about user folders, I take only the user of the folder should have permissions to access it. Note that the script will just create the folders, not give them the permissions.

Cheers,
Dian
 
Then you could do this in a logon script, and at the top level, make Admins and Creator Owner the only ones with permissions.

You could also use xcacls from the resource kit to change permissions after creating.
 
How does Excel figure in? You can write a macro that does everything mentioned. E.g.

Sub Macro1()
MkDir "C:\Folder1"
End Sub


Cheers,
ND [smile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top