Solved

writing a batch script with ownership changes and cacls permission changes

Posted on 2004-10-02
6
516 Views
Last Modified: 2011-10-03
The specific circumstance is I have a folder that is used to store completed documents in for all to read but none to change. First of all the user who creates these documents needs a way to transfer them into this folder.

Once that occurs I need to remove the change permissions from that user and anyone else who was carried over from the originating folder.

Hence the reason for this loop.
g:
cd Quality
CD\MyFolder
for %a in (*.*) do cacls %a /T /G "X\Domain Admins":F "X\Domain Users":R "X\QualityDocCtrl-Admin":R<yes.txt

I also tried to get around the issue of ownership by changin the owner on the top folder manusally and checking the box that says to do the same for subfolders.

This loop does not work in a batch program it errors out saying a problem with a.

suggestions for doing the loop and changing the owner are appreciated,

sirbounty contributed the original suggestion,

thanks,


Don
0
Comment
Question by:dprice7
6 Comments
 
LVL 23

Accepted Solution

by:
Tim Holman earned 50 total points
ID: 12208305
Setup two shares.  One that allows users write access only to the resource, and the other that allows users read access only to the resource.
That way, users will only be able to write files to their X: for example, and everyone can read only with their Y:.
0
 

Author Comment

by:dprice7
ID: 12209086
tim,

This is an alternative but does not answer my questions.

thanks,

Don
0
 
LVL 95

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 75 total points
ID: 12210721
In a batch file, you must use a double % with the a - %%a
0
New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

 

Author Comment

by:dprice7
ID: 12213003
Hey leew,

good catch.

Do you know anything about changing the ownership in batch like the questions asks?

thanks,

Don
0
 
LVL 95

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 75 total points
ID: 12213950
0
 
LVL 8

Expert Comment

by:nader alkahtani
ID: 12231416
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article is in response to a question (http://www.experts-exchange.com/Networking/Network_Management/Network_Analysis/Q_28230497.html) here at Experts Exchange. The Original Poster (OP) requires a utility that will accept a list of IP addresses …
Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

896 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