Looks like you need to take ownership of the files.
I'm at home on Linux, so I can't try anything, but I think you should take a look at ICACLS with the /setowner option.
ICACLS is like CACLS on steroids.
Icacls
Hi,
I am trying to use the CACLS.exe command to modify ACL's in my user directory. When I run the command it lists the directories, but, comes up after with access denied.
Heres my script...
cacls "D:\Userdata" /t /e /g "Administrators":F
obviously replacing "d:\userdata" with the user data directory
Any Ideas?!
Looks like you need to take ownership of the files.
I'm at home on Linux, so I can't try anything, but I think you should take a look at ICACLS with the /setowner option.
ICACLS is like CACLS on steroids.
Icacls
rjones (24-11-2009)
Hi,
Thanks for your reply. I was hoping to change the ACL's without having to take ownership.
Going to try and add this script to a logon script... hoping that as the user has full access rights, that they should be able to change permissions.
If not will give your suggestion a go.
Thank you once again!
If you're expecting the user running the script to be owner then it will do no harm to forcibly set the owner - if they're already owner, it makes no change.
If they're not owner then you make them owner and allow the permissions change.
Hi,
I don't think you need the speech marks around Administrators.
Below is a line from a script which works and I have deployed using a GPO.
cacls "c:\Program Files\Sherston\Money Mice\saves" /e /g everyone:c
Only the path is in speech marks.
Hope that helps,
Steve.
Last edited by SteveCIS; 24-11-2009 at 04:22 PM.
There are currently 2 users browsing this thread. (0 members and 2 guests)