Solved

writing a batch script with ownership changes and cacls permission changes

Posted on 2004-10-02
6
521 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
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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