?
Solved

Changing Permissions on Multiple Subfolders

Posted on 2008-10-21
3
Medium Priority
?
249 Views
Last Modified: 2013-12-04
I have hundreds of folders on my file server for each Job my company works on.  Under each of these Job folders are multiple subfolders.  One of these subfolders is named Legal.  I need to edit the permissions on the Legal folder only under every Job folder.  Is there a way to do this automatically or do I have to go to each Legal folder and make the change.  I've looked for a utility to use but can't seem to find one.  I have a very limited knowledge on scripting so I don't know if that is an option or not.

Thanks for any help or suggestions,
0
Comment
Question by:lavadour
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 38

Accepted Solution

by:
Shift-3 earned 2000 total points
ID: 22768881
Paste the script below into a text file with a .cmd extension.  Customize the value of the root variable with the location of the folder containing the job folders.  Customize the value of the switches variable with the cacls switches to run on the Legal folders.  See here for syntax:
http://www.ss64.com/nt/cacls.html

Running the script will change permissions on every folder named Legal located directly under each of the job folders.


@echo off
setlocal
 
set root=c:\files
set switches=/E /C /G "authenticated users":F
 
for /F "tokens=*" %%G in ('dir "%root%" /A:D /B') do (
 if exist "%root%\%%G\Legal" cacls "%root%\%%G\Legal" %switches%
)

Open in new window

0
 

Author Comment

by:lavadour
ID: 22768932
I will give it a try, thanks for the quick response.  Like I mentioned I know very little about scripting but this sould like it will work for me.
0
 

Author Comment

by:lavadour
ID: 22843913
Thank  you, this worked.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

As I write this article, I am finishing cleanup from the Qakbot virus variant found in the wild on April 18, 2011.  It was a messy beast that had varying levels of infection, speculated as being dependent on how long it resided on the infected syste…
Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

765 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