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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to create folders

Status
Not open for further replies.

Peanut2005

Technical User
Apr 26, 2005
11
GB
Hi Everyone,

I have been tasked with a really long winded process of creating new folders for all of our 100 users. The folders should be named according to their usernames ie user1, user2, user3 etc. Is there anyway that I could run some sort of script that will enable me to to supply their usernames as input and have the script create them for me?

Many thanks in advance,

P
 
Take a look at the InputBox function and the CreateFolder method of FileSystemObject.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
If you have a list of the usernames and Excel you can try this method.

1. In column one type "md" (without quotes)
2. In column two type the path you want the folders created in, including the folder name like "c:\users\user1" and so on. (one per each row)
Column one should contain "md" for each entry in column two.

3. Do a File>Save as. Save it as Text(MS-DOS). Close Excel.
4. Open the text file to make sure each line says md c:\users\user1, user2, etc.
5. Change the .txt extension to .bat or .cmd (.cmd seems to run faster)
 
Excellent!

Many thanks guys, i'll give this a try.

P
 
Take a look at this thread
thread329-1046662

Only the good die young, me I'm here forever :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top