Creating folders (bulk)

  • Thread starter Thread starter Chris S
  • Start date Start date
C

Chris S

Hi there - I've been thrown in the deep end and would appreciate any help.

We have a shared directory where a list of folders appears (each named after
each user's username).

e.g. User1, User2, User3 etc

I need to create a folder called "Private" under each folder, and would love
to know how to do this via a script/batch file. Would rather not manually
create for the whole organisation (+1000 users).

I'd be happy with just that although the next step will be limiting access
to this private folder to just that particular user. At the moment everybody
has Read so everybody can view what appears in each folder, but only the
owner (corresponding user) can write/modify.

Would be grateful for any help.

Cheers,
Chris (csotiriasAThotmail.com)
 
Hi Chris,

Try entering this at the command prmopt, where C:\Homedirs is the parent
directory housing all the directories named by username.

C:\>for /f %a in ('dir /b /a:d C:\homedirs') do (mkdir
C:\homedirs\%a\private & cacls C:\homedirs\%a\private /g
YOUR_DOMAIN_NAME\%a:F)


Watch for line wrap. That's all one line.

Ray at work
 
I suggest that you use MS access or MS Excel to generate your folder paths.
Then use a script to create the folders automatically.

Permission commands

- Cacls
Microsoft Knowledge Base Article - 135268

- Search:Xcacls

http://search.microsoft.com/search/results.aspx?st=b&na=88&View=en-us&qu=xcacls


URL to useful sripts

http://www.microsoft.com/technet/community/scriptcenter/filefolder/scrff15.mspx

Script Center
http://www.microsoft.com/technet/community/scriptcenter

Just copy the scripts to a text files and save it with Filename.VBS.
You will be able to run them

Amil Fortuna
Masters Science:Computer Science
MCP
 
Back
Top