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?
There are a couple of things wrong.
Firstly you haven't specified a user/group that you want to apply the permissions to
Example
Secondly, there is no
/y
switch forcacls
. If you want to automatically sayy
to the confirmation you can use thisSo your full batch file would look similar to this
Hope this helps