Windows Server file Permissions chown

CheatSheetCheatSheet of useful CMD commands for Windows Server to folder and files permissions like chmod and chown. (continually updated)

Take ownership of whole content folder and sub files/dirs:

  • takeown – Enables an administrator to recover access to a file that previously was denied, by making the administrator the owner of the file.
  • icacls -Displays or modifies discretionary access control lists (DACLs) on specified files, and applies stored DACLs to files in specified directories.
takeown /f "C:folder" /r /d y
icacls "C:folder" /grant logged_user:F /t /q

Where:

takeown: /f = <Folder name>; /r = recursive; /d y = take ownership of the dir
icacls: <Folder name>; /grant = <Username>:R, W, F (full control); /t = apply for all files and subdirs; /q = show status messages

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.