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
Solved

Changing Permissions on Multiple Subfolders

Posted on 2008-10-21
3
243 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
OfficeMate Freezes on login or does not load after login credentials are input.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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