Saturday, 18 January 2014

Windows 7: Take File & Folder Ownership & Reset File & Folder Permissions

To take ownership of the folder at the top of the tree and all sub files and folders:

TAKEOWN /F "Folder Name" /R

/F specifies the filename or directory name pattern. Wildcard "*" can be used to specify the pattern.

/R instructs tool to operate on files in specified directory and all subdirectories.

To reset file and folder permissions back to the default inherited permissions:

ICACLS "Folder Name" /RESET /T /C /Q

/T indicates that this operation is performed on all matching files/directories below the directories specified in the name.

/C indicates that this operation will continue on all file errors. Error messages will still be displayed.

/Q indicates that icacls should suppress success messages.