In this case, users will probably have to right click on the object, then access the object’s properties. Then users have to click on Security tab, click on Advanced button, click on Owner tab, and then perform several clicks and confirmations to take ownership of the object. The whole process have to repeat again to grant read-write-modify or full control access rights to the users. The whole process takes lengthy time, troublesome, involves lots of clicks and steps. To simplify the process, simply download the TakeControlOf.cmd command line batch script, which will automatically take ownership and grant full control access rights by assigning new ACLs (Access Control Lists) to the file or directory that input to the command.
TakeControlOf.cmd makes use of two command-line utilities takeown (takes ownership of a file or directory) and icacls (sets new ACLs on a files or directory) respectively. Full Control access privilege will be given to Administrators group.
To use the batch script, simply launch an elevated command prompt, then run the script. Below is same examples (command should be issued from the directory where you store the TakeControlOf.cmd script):
The script works on all versions of Windows and Windows Server, from Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016 or later.