Take Ownership a folder

Change ownership recursively:

To change the ownership of a folder, its subfolders, and files in each subfolder, use this syntax:

takeown /f <foldername> /r /d y

The currently logged on user is now the owner of the folder.

To set Administrators group the owner of the folder, its subfolders, and files recursively, use the /A switch in addition:

TAKEOWN /F <foldername> /a /r /d y
  • /R Recurse: instructs the tool to operate on files in the specified directory and all subdirectories.
  • /D prompt Default answer used when the current user does not have the “list folder” permission on a directory. This occurs while operating recursively (/R) on sub-directories. Valid values “Y” to take ownership or “N” to skip.

Assign Folder Permissions

Then to assign the Administrators group Full Control Permissions for the folder, use this syntax:

icacls <foldername> /grant administrators:F /T

The /T parameter is added so that the operation is carried out through all the sub-directories and files within that folder.

1 comment:

  1. How to win at a Casino: Roulette and Slots - Mapyro
    Casino · Play the Best Roulette & Slots · A 포항 출장마사지 minimum deposit of £5 will be required for 제주도 출장안마 the games 논산 출장샵 to be good to players. · Place a minimum 충청북도 출장마사지 of £5 세종특별자치 출장샵 bet

    ReplyDelete