Create 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)
 
Chris S said:
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)

Try this:

@echo off
cd /d d:\shares
for /d %%a in ("*.*") do (
if not exist "%%a\Private" md "%%a\Private"
cacls "%%a\Private" /T /E /P %%a:W
pause
)

Remove the Pause command when you're convinced that it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top