I can use takeown.exe to give the currently logged in user ownership of a folder. But when I try:
takeown /s jimswork8 /u Everyone /f c:\test /R /D Y
It just gives ownership to the currently logged in user. I CAN do it if I use the UI, so I would think it is possible, but I just can't get the syntax right.
Thanks
takeown is a leftover from the days when Microsoft insisted you couldn't set the ownership of a file to someone other than the person logged on. I don't know why the tool lets you specify a username, but it will not honor it as far as I know.
icacls
will allow you to set the owner from the command line. But it will not update ACEs. If the file/folder is simply inheriting permissions, following the/setowner
command with a/reset
command will fix the ACEs.This set owner of folder or file to group
Everyone
- works on windows 7 and above: