Every so often I run into a file that I need to take ownership of. I normally use cacls for changing ntfs permissions, but it doesn't seem to do ownership. Under *nix I would run something like chown me:me <file>. Is there a windows equivalent to chown?
|
| ||||
|
feedback
|
|
subinacl is a Windows sysadmin's power tool for doing everything to do with ownership and ACLs. You can change the ownership to anyone other than just you (you can't do this with the GUI).
This lets you set the permission to any user you like, without having to be an administrator (as I believe takeown.exe requires). | |||
|
feedback
|
|
You're looking for "TAKEOWN.EXE", which was first in Windows Server 2003 as a standard component, and I believe a resource-kit item prior. See: http://technet.microsoft.com/en-us/library/cc738152(WS.10).aspx | ||||
|
feedback
|
|
For Windows 2003, XP, 2008 or Vista or 7 use Takeown: For Windows 2000 use Fileowners.pl. | |||||
|
feedback
|
|
You might want to take a look at SetACL, the swiss army knife of permission management. Here is an example of how to assign ownership of all files on drive C: to "Administrators" and remove protection of inheritance from all child objects in one go:
| |||
|
feedback
|
|
In Windows Server 2003 R2 (and later) you can take advantage of the built-in tool icacls.exe to change ownership from the command line, as well as all of the traditional cacls.exe manipulations upon which it expands... Note that icacls.exe defaults to "edit" mode, while cacls.exe defaults to "replace" mode--a welcome change to those of us bitten (more than once) by that little nuance of cacls! | |||
|
feedback
|
|
Another alternative is fileacl It is small and can set/unset "inherit/don't inherit" flag on the object, unlike most windows utils. | |||
|
feedback
|