Solved

writing a batch script with ownership changes and cacls permission changes

Posted on 2004-10-02
6
522 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 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
Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

735 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