0

I would like to lock a series of file from my staff so they can not delete them i have thus compiled a script wich puts the CACLS function into a loop. however this is not taking effect.

could somebody please explain why?

FOR /F %%i IN (c:\file.txt) DO CACLS %%i /p :n /y

I have been able to narrow it down to the /y at the end how can i continue to Automate the yes?

LabRat
  • 1,996
  • 11
  • 56
  • 91

1 Answers1

0

There are a couple of things wrong.

Firstly you haven't specified a user/group that you want to apply the permissions to

Example

CACLS %%i /p Everyone:n /y

Secondly, there is no /y switch for cacls. If you want to automatically say y to the confirmation you can use this

echo y| CACLS %%i /p Everyone:n /y

So your full batch file would look similar to this

FOR /F %%i IN (c:\file.txt) DO echo y| CACLS %%i /p Everyone:n

Hope this helps

Bali C
  • 30,582
  • 35
  • 123
  • 152
  • yeah this helps if I change the y| to j| and the Everyone:n to iedereen:n for a dutch windows version (sucks whish that thre would be a language independent method) – LabRat Oct 10 '12 at 15:37