Solved

writing a batch script with ownership changes and cacls permission changes

Posted on 2004-10-02
6
514 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Downtime reduced, data recovered by utilizing an Experts Exchange Business Account Challenge The United States Marine Corps employs more than 200,000 active-duty Marines with operations in four continents, all requiring complex networking system…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

16 Experts available now in Live!

Get 1:1 Help Now