Solved

Changing Permissions on Multiple Subfolders

Posted on 2008-10-21
3
241 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
  • 2
3 Comments
 
LVL 38

Accepted Solution

by:
Shift-3 earned 500 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

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Join & Write a Comment

In today's information driven age, entrepreneurs have so many great tools and options at their disposal to help turn good ideas into a thriving business. With cloud-based online services, such as Amazon's Web Services (AWS) or Microsoft's Azure, bus…
This is a guide to the following problem (not exclusive but here) on Windows: Users need our support and we supporters often use global administrative accounts to do this. Using these accounts safely is a real challenge. Any admin who takes se…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 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

12 Experts available now in Live!

Get 1:1 Help Now