How can I change the permissions for a complete local disk (and all the files and folders within it) using the command prompt?
My username is XYZ
and drive is local disk I
.
permissionswindows 7
How can I change the permissions for a complete local disk (and all the files and folders within it) using the command prompt?
My username is XYZ
and drive is local disk I
.
Best Answer
Takeown
You can use
takeown
for this.Example:
Where:
/r
: Is a recursive operation on all files in the specified directory and subdirectories./d
: Suppresses the confirmation prompt that is displayed when the current user does not have the List Folder permission on a specified directory./f
: Specifies the file name or directory name pattern. You can use the wildcard character*
when specifying the pattern.Icacls
You can also use the
icacls
utility for this.Example:
Where:
F
: Full Control.CI
: Container Inherit - This flag indicates that subordinate containers will inherit this ACE.OI
: Object Inherit - This flag indicates that subordinate files will inherit the ACE.