Jump to content

Takeown for XP


midnight rambler

Recommended Posts

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Quickly takes ownership of files and folders with right click in Windows XP, Vista and 7 including executible

files without replacing with the "Run as"... feature like the other versions

of this tool available at many websites do so you can still run programs with elevated priveledges.

This is good becouse the other codes from then internet don't work well with Windows 7

by interfearing with the operations of certain programs such as backup and restore when trying make it work by adding the code for .exe files.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

The first step is to download a command line utility "subinacl.exe" http://www.microsoft.com/downloads/details...;displaylang=en

and install it.

After you install it browse to "X:\Program Files\Windows Resource Kits\Tools" and copy "subinacl.exe" to "x:\windows\system32" and then be sure to delete it from "X:\Program Files\Windows Resource Kits\Tools" where it installs.

Important: make sure "subinacl.exe" is not in any other folder than system32 such as the program files installation directory or else it won't work. It should only be in system32.

The second step is to select all of the text in this codebox, copy and paste the text to a new text file then save it.

COPY subinacl.exe %systemdrive%\WINDOWS\system32\

REM FILE

echo y| reg add "HKEY_CLASSES_ROOT\*\shell\Take Ownership" /ve /d "Take Ownership"
echo y| reg add "HKEY_CLASSES_ROOT\*\shell\Take Ownership" /v "HasLUAShield"
echo y| reg add "HKEY_CLASSES_ROOT\*\shell\Take Ownership\command" /ve /d "CMD /C subinacl.EXE /file ""%%1\"" /owner=%username% && subinacl.EXE /file ""%%1\"" /grant=%username%=f"

REM Folder

echo y| reg add "HKEY_CLASSES_ROOT\Folder\shell\Take Ownership" /ve /d "Take Ownership"
echo y| reg add "HKEY_CLASSES_ROOT\Folder\shell\Take Ownership" /v "HasLUAShield"
echo y| reg add "HKEY_CLASSES_ROOT\Folder\shell\Take Ownership\command" /ve /d "CMD /C subinacl.EXE /file ""%%1\"" /owner=%username% && subinacl.EXE /subdirectories ""%%1\*.*\"" /owner=%username% && subinacl.EXE /file ""%%1\"" /grant=%username%=f && subinacl.EXE /subdirectories ""%%1\*.*\"" /grant=%username%=f"


REM .CMD FILE


echo y| reg add "HKEY_CLASSES_ROOT\cmdfile\shell\Take Ownership" /ve /d "Take Ownership"
echo y| reg add "HKEY_CLASSES_ROOT\cmdfile\shell\Take Ownership" /v "HasLUAShield"
echo y| reg add "HKEY_CLASSES_ROOT\cmdfile\shell\Take Ownership\command" /ve /d "CMD /C subinacl.EXE /file ""%%1\"" /owner=%username% && subinacl.EXE /file ""%%1\"" /grant=%username%=f"



REM .EXE FILE

echo y| reg add "HKEY_CLASSES_ROOT\exefile\shell\Take Ownership" /ve /d "Take Ownership"
echo y| reg add "HKEY_CLASSES_ROOT\exefile\shell\Take Ownership" /v "HasLUAShield"
echo y| reg add "HKEY_CLASSES_ROOT\exefile\shell\Take Ownership\command" /ve /d "CMD /C subinacl.EXE /file ""%%1\"" /owner=%username% && subinacl.EXE /file ""%%1\"" /grant=%username%=f"

Now you want to change file extension of the new text file from ".txt" to ".cmd".

Finally, right click on the .cmd file and select "Open" from the top of the menu to add the code to your registry. You are done!

Now you can right click on any file or folder and select ,' Take Ownership" from the context menu and you will have full permisions on that file or folder including all of it's contents.

Updated 10-20-2009 to work on all files in windows 7 and preserve the "Run as..." feature.

Edited by midnight rambler
Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...