Take Ownership and Grant ‘Full Control’ Recursively

KB ID 0001200 Dtd02/06/16

Problem

I had a bunch of old user profile folders I needed to delete today, When setup properly even the domain administrator can’t get in there and delete them;

001 - No Permissions

If it’s just one folder then simply take ownership, grant yourself rights and delete it! But I had a lot of folders so I needed a more robust (read less work) solution.

 

Solution

Take Ownership of all Folders/Sub-Folders, and Files

Open an administrative command window, and execute the following command;

takeown /a /r /d Y /f C:\{foldername}

Take Ownership all files and folders recusively

Grant ‘Full Control’ Rights to all Folders/Sub-Folders, and Files

Just because you are the owner, that does not mean you have any rights to the folders and files, to grant full control to the administrators group.

icacls C:\{foldername} /grant administrators:F /t

003 -Grant Full Control Recursively

 

Related Articles, References, Credits, or External Links

Can’t Delete a File or Folder or Take Ownership

Author: PeteLong

Share This Post On

2 Comments

  1. Hello Pete,

    Appreciate the help from your website but, here’s the thing.

    Some very bad russians managed to dump something on our server in the sysroot\sys32 folder and even tho your solution will grant full perms for everything, it will not release this one file. If you have any thoughts on this, they would be gladly received.

    tia if you do.

    Gary

    Post a Reply
    • IF=f it’s immovable boot with a Linux DVD and mount the partition – then you will be able to delete it, or try MoveOnBoot

      Pete

      Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *