Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cacls script question 1

Status
Not open for further replies.

Blutch

IS-IT--Management
Sep 19, 2002
203
BE
Hi, I wanna put ntfs perms on every user home folder. I use the following in a script:

FOR /D %%I in (*.) do cacls d:\users\%%I /G %userdomain%\%%I:C /T

When I execute the script in the users folder I have to enter y or n on every folder and then I get an Access denied (Domain Admins have full control on the folder so???)

Can anyone help me here?
 
You can use the xcacls utility which does allow the /y:
xcacls "F:\Directory" /e /g "Domain Users":R /y

_____________________________________
S. Daniel P. Teixeira - MCP
 
Thx for the advice.
Can I whith the same command set permissions for different groups on the same folder, f.ex. Domain Admins FC, user CH, ...

When I try to do this it replaces the permissions?
 
XCACLS may be one option. What I do is create a text file called y.txt with the letter "y" and a carriage return. For example, type in:

Code:
copy con y.txt
y
<Enter/Return Key ONCE>
<F6 key>

Then use input redirection to answer the cacls question:
Code:
FOR /D %%I in (*.) do cacls d:\users\%%I /G %userdomain%\%%I:C /T<y.txt
 
Yeah right, found the way. I user /g every time (like rmtshare /grant) but isn't necessary (once is enough)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top