Change File Permissions On Multiple Folders

Posted on 2006-04-19
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
    LVL 12

    Accepted Solution

    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:

    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


    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

    Very useful, or very destructive, indeed.

    pbait, thank you for the reward and good luck.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    The term "Bad USB" is a buzz word that is usually used when talking about attacks on computer systems that involve USB devices. In this article, I will show what possibilities modern windows systems (win8.x and win10) offer to fight these attacks wi…
    In a recent article here at Experts Exchange (, I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now