Solved

writing a batch script with ownership changes and cacls permission changes

Posted on 2004-10-02
6
523 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
[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
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 96

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
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!

 

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 96

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
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 …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 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