Solved

Changing Permissions on Multiple Subfolders

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

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…
OfficeMate Freezes on login or does not load after login credentials are input.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 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