Add Take Ownership to right-click menu in Windows XP

If you want to take ownership of a file or folder in Windows XP, then you have to go through many steps. But you can add the whole series of commands to the right-click context menu so that you can just right-click on a file or folder and choose Take Ownership to take the ownership of the selected item. Here is how :

Part 1 – Getting all the files

  1. The the command cacls included in Windows XP does not allow you to take ownership of an object. So we have to download a much more powerful command line tool subinacl from Microsoft. You can download this tool by clicking here. Once downloaded, install subinacl by following the easy steps and choosing the default values in the setup program.
  2. Open Windows Notepad. Copy/paste the following in it and save the file as C:\TakeOwnFile.cmd .
    @echo off
    “%ProgramFiles%\Windows Resource Kits\Tools\subinacl.exe” /file %1 /owner=Administrators /grant=Administrators=F

    TakeOwnFile.cmd in Windows Notepad

    It is assumed that you installed the subinacl tool in the default folder as explained in step 1.

  3. Similarly, create a file C:TakeOwnDir.cmd with the following contents :
    @echo off”
    %ProgramFiles%\Windows Resource Kits\Tools\subinacl.exe” /subdirec %1 /owner=Administrators /grant=Administrators=F

Part 2 – Modifying the Registry

  1. Press the keyboard shortcut Windows logo key + R to open the Run dialog. In the Run dialog, type regedit and press Enter. This will open the Windows Registry Editor.

    Run dialog for running Registry Editor

  2. In the Windows Registry Editor, navigate to the following key :
    HKEY_CLASSES_ROOT\*\shell
  3. Right-click on shell key and select New → Key to create a sub-key. Put the name of the key ownership. Change the default value of the newly created key to Take Ownership.

    Adding TakeOwnership to files right-click menu

  4. Now right-click on ownership key and select New → Key to create a sub-key. Put the name of the key command. Change the default value of the newly created key to :
    “C:\TakeOwnFile.cmd” “%1”

    Adding TakeOwnership to files right-click menu

  5. We just finished added right-click menu for all files. Now we will add right-click menu to all the folders. In the Windows Registry Editor, navigate to the following key :
    HKEY_CLASSES_ROOT\Directory\shell
  6. Right-click on shell key and select New → Key to create a sub-key. Put the name of the key ownership. Change the default value of the newly created key to Take Ownership.

    Adding TakeOwnership to folders right-click menu

  7. Now right-click on ownership key and select New → Key to create a sub-key. Put the name of the key command. Change the default value of the newly created key to :
    “C:\TakeOwnDir.cmd” “%1”

    Adding TakeOwnership to folders right-click menu

Alternatively, you can download the ready made Registry Entries and others files in one zip file : take_ownership_xp.zip. Download the ZIP file and extract the contents to your desktop. Then copy the files TakeOwnFile.cmd and TakeOwnDir.cmd to C: folder. And double-click on the add_take_ownership_xp.reg. Choose Yes when asked.