Change File Permissions On Multiple Folders

Posted on 2006-04-19
Medium Priority
Last Modified: 2013-12-04
I've got a file structure similar to the following.  Each line below represents a subfolder:


This structure exists for several hundred projects.  I want to change the file permissions on the "folder1a", but I don't want to go to each individual folder if possible.  The new permissions would be identical for all of the projects.

Is there a utility (or something built-in to Windows) to allow me to select all (or at least several) of the folders at once and set the permissions?

The file system is Windows Server 2003.

Question by:pbait
  • 2
LVL 12

Accepted Solution

Rant32 earned 2000 total points
ID: 16491595
Use the CACLS or XCACLS command to set permissions from the command line, in conjunction with FOR to loop through folders. CACLS is readily available in 2003, XCACLS is the extended version. Free download here: http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/xcacls-o.asp

The for loop does this (these commands are not harmful, they don't change anything because of the ECHO statement):

D:\Fileserver\Projects> for /D %f in (*.*) do @echo "%f"

/D loops through folders only, not files. %f is replaced with the folder name and should be between "" if it contains spaces.
Here you get the idea of FOR. Then have a look at the CACLS command line (CACLS /?). The end command goes something like this (leave the echo out):

D:\Fileserver\Projects> for /D %f in (*.*) do @echo cacls "%f\Folder1\Folder1a" /G UserGroup:C /E

Test this on a veryveryvery unimportant test copy of your data so you know what it does... but this is a very powerful command, and you can even nest for loops for the really complex stuff.

Author Comment

ID: 16499292

Thanks for the quick and certainly detailed answer.  I feel like I've got a potential nuclear device in my hands now, but I will heed your advice and thoroughly test on something non-production.
LVL 12

Expert Comment

ID: 16500259
Very useful, or very destructive, indeed.

pbait, thank you for the reward and good luck.

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
SHARE your personal details only on a NEED to basis. Take CHARGE and SECURE your IDENTITY. How do I then PROTECT myself and stay in charge of my own Personal details (and) - MY own WAY...
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question