How to obtain file management ownership of Windows 7

  

Starting from VISTA, Microsoft has significantly improved the security of the operating system, so that the files (folders) that we can open or delete under XP can not be performed under WIN7. operating. Even if it is under the Administrator super administrator account, it is impossible to operate. Prompt "You need permission from TrustedInstaller to make changes to this folder", or the prompt location is unavailable, and access is denied.

Especially to clean up the system garbage, no matter what tools are used, you can't clean up the files in the protected folder. For the convenience of operation, here is a registry file. After importing the registry, you only need to The file (folder) of the operation is right clicked —— the administrator takes ownership so that you can open or delete it.


It is important to note that if you are not very proficient in the system structure, please do not delete the files that are useful to the system! ! !

The contents of the registry are as follows:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT*shellrunas] @="Administrator Ownership" "NoWorkingDirectory"=" "

[HKEY_CLASSES_ROOT*shellrunascommand] @="cmd.exe /c takeown /f "%1" & icacls "%1" & icacls "%1" /grant administrators: F" "IsolatedCommand"="cmd.exe /c takeown /f "%1" & icacls "%1" /grant administrators:F"

[HKEY_CLASSES_ROOTexefileshellrunas2] @="Manage Ownership " "NoWorkingDirectory"=""

[HKEY_CLASSES_ROOTexefileshellrunas2command] @="cmd.exe /c takeown /f "%1" & icacls "%1" & Icacls "%1" /grant administrators:F" "IsolatedCommand"="cmd.exe /c takeown /f "%1" & icacls "%1" /grant administra Tors:F"

[HKEY_CLASSES_ROOTDirectoryshellrunas] @="Administrator Ownership" "NoWorkingDirectory"=""

[HKEY_CLASSES_ROOTDirectoryshellrunascommand] @="cmd.exe /c Takeown /f "%1" /r /dy & icacls "%1" & icacls "%1" /grant administrators:F /t" "IsolatedCommand"="cmd.exe /c takeown /f "%1" /r /dy & icacls "%1" /grant administrators:F /t"



It can also be used in Windows 7, but it can't be used under Win7SP1 system platform. Here is a registry for Win7SP1 platform:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\\*\\ Shell\ unas] @="Administrator Ownership" "NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\\*\\shell\ unas\\command] @="cmd.exe /c takeown /f \\"%1\\" && icacls \\ "%1\\" /grant administrators:F" "IsolatedCommand"="cmd.exe /c takeown /f \\"%1\\" && icacls \\"%1\\" /Grant administrators:F"

[HKEY_CLASSES_ROOT\\exefile\\shell\ unas2] @="Administrator Ownership" "NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\\exefile\\ Shell\ unas2\\command] @="cmd.exe /c takeown /f \\"%1\\" && icacls \\"%1\\" /grant administrators:F" "IsolatedCommand"= "cmd.exe /c takeown /f \\"%1\\" && icacls \\"%1\\" /grant administrators:F"

[HKEY_CLASSES_ROOT\\Directory\\shell\\ Runas] @="Administrator Ownership" "NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\\Directory\\shell\ unas\\command] @="cmd.exe /c takeown /f \\"%1\\" /r /dy && icacls \\"%1\\" /grant administrators:F /t" &q Uot;IsolatedCommand"="cmd.exe /c takeown /f \\"%1\\" /r /dy && icacls \\"%1\\" /grant administrators:F /t"





Copyright © Windows knowledge All Rights Reserved