如何在 Windows 10 中删除受 TrustedInstaller 保护的文件:(How to Delete Files Protected by TrustedInstaller in Windows 10:) TrustedInstaller是Windows Modules Installer的一个进程,它拥有大量系统文件、文件夹和其他程序。是的,TrustedInstaller是Windows Modules Installer服务用来控制这些受保护的系统文件和文件夹的用户帐户。是的,即使您是管理员,它们也不归您所有,您也不能以任何方式修改这些文件。
如果您尝试重命名、删除、编辑TrustedInstaller(TrustedInstaller)拥有的这些文件或文件夹,您最终会收到一条错误消息,指出“您无权执行此操作”和“您需要TrustedInstaller的许可才能对此进行更改文件或文件夹”。
好吧,不用担心,要在Windows 10中删除受(Windows 10)TrustedInstaller保护的文件,您必须首先获得您要删除的文件或文件夹的所有权。一旦您拥有所有权,您就可以向您的用户帐户授予完全控制权或权限。
我可以从文件所有权中删除TrustedInstaller用户帐户吗?
简而言之,是的,您可以,重要的是您不要这样做,因为创建TrustedInstaller用户帐户是为了保护系统文件和文件夹,例如,如果您的 PC 受到病毒或恶意软件攻击,那么他们将无法修改系统文件或文件夹,因为这些文件和文件夹受TrustedInstaller保护。如果您仍然尝试从文件所有权中删除TrustedInstaller用户帐户,您将收到一条错误消息:
您无法删除TrustedInstaller,因为此对象从其父对象继承权限。要删除TrustedInstaller,您必须阻止此对象继承权限。关闭继承权限的选项,然后重试。
听起来很简单,但获取文件所有权的过程要长一点,但不要担心,这就是我们在这里的原因。在本文中,我将引导您逐步了解如何通过从(How)TrustedInstaller取回文件或文件夹的所有权来删除(Delete Files Protected)Windows 10中受TrustedInstaller保护的文件。
在Windows 10中删除受 TrustedInstaller 保护的文件(Delete Files Protected)的3(TrustedInstaller)种方法(Ways)
确保 创建一个还原点(create a restore point)以防万一出现问题。
方法 1: 在 Windows 10 中(Method 1: )手动 (Manually )获取文件或文件夹的所有权 (Take Ownership of Files or Folders in Windows 10 )
1.打开要从TrustedInstaller 收回所有权的文件或文件夹。(TrustedInstaller.)
2.右键单击特定文件或文件夹(Right-click on the particular file or folder)并选择属性。(Properties.)
3.切换到安全选项卡(Security tab),然后单击高级按钮。
(Advanced button.
)
4.这将打开“高级安全设置”(Advanced Security Settings)窗口,您可以在其中看到TrustedInstaller对此特定文件或文件夹具有完全控制权。( TrustedInstaller has the Full Control)
5.现在在所有者(Owner)名称(即TrustedInstaller )旁边单击更改。(Change.)
6.这将打开选择用户或组窗口( Select User or Group window),再次单击底部的高级按钮。( Advanced button)
7.将打开一个新窗口,单击“立即查找(Find Now)”按钮。
8.您将看到“搜索结果:(Search results:) ”部分中列出的所有用户帐户,从该列表中选择用户帐户(select the user account)以成为文件或文件夹的新所有者,然后单击确定。
9.再次单击“选择用户(Select User)或组(Group)”窗口上的“确定”。
10.现在您将进入高级安全设置(Advanced Security Settings)窗口,如果您需要删除文件夹中的多个文件,请在此处选中(checkmark)“替换子容器和对象的所有者”。(Replace owner on subcontainers and object)
11.单击应用,然后单击确定。
12.从文件夹或文件属性窗口,再次单击安全选项卡(Security tab.)下的高级按钮。(Advanced button)
13.没有点击添加按钮(Add button)打开权限条目(Permissions Entry)窗口,然后点击“选择一个主体(Select a principal)”链接。
14.再次单击高级按钮(Advanced button),然后单击立即查找。(Find Now.)
15.选择您在步骤 8 中选择的用户帐户,然后单击确定。(Select the user account)
16.您将再次被带到权限条目(Permissions Entry)窗口,您需要在此处选中“基本权限”下(Basic permissions)的所有框(checkmark all the boxes)。
17.此外,选中(checkmark)“Only apply these permissions to objects and/or containers within this container”,然后单击“确定”。
18.您将收到安全警告,单击“是”继续。( Yes to continue.)
19.单击应用(Apply),然后单击确定,然后再次单击文件/文件夹属性窗口上的确定。
20.您已成功更改文件或文件夹的所有权,( changed the ownership of the file or folder,)现在您可以轻松修改、编辑、重命名或删除该文件或文件夹。
现在您可以使用上述方法轻松删除 Windows 10 中受 TrustedInstaller 保护的文件(delete files protected by TrustedInstaller in Windows 10),但如果您不喜欢经历这个漫长的过程,您也可以使用以下方法在右键单击中添加“获取所有权”选项上下文菜单并轻松获取Windows 10中任何文件或文件夹的所有权。
Method 2: Take Ownership of Files/Folders in Windows 10 using Registry
1.打开记事本(Notepad)文件,然后将以下代码复制并粘贴到记事本文件中:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\runas]
[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
[-HKEY_CLASSES_ROOT\dllfile\shell\runas]
[HKEY_CLASSES_ROOT\dllfile\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\dllfile\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
[-HKEY_CLASSES_ROOT\exefile\shell\runas]
[HKEY_CLASSES_ROOT\exefile\shell\runas]
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="\"%1\" %*"
"IsolatedCommand"="\"%1\" %*"
2.从记事本(Notepad)菜单中单击文件(File),然后选择另存为。(Save As.)
3.从保存(Save)类型下拉列表中选择“All Files (*.*) ”,然后输入文件名,可以是任何您想要的名称,但请确保在其末尾添加 .reg(add .reg at the end of it)(例如,takeownership. reg) 因为这个扩展非常重要。
4.导航到要保存文件的位置,最好是桌面,然后单击“保存”按钮。(Save button.)
5.现在右键单击上述文件 ( Registry_Fix.reg ) 并从上下文菜单中选择安装。(Install )
注意:(Note:)您需要管理员帐户才能将脚本安装到Windows注册表文件中。
6.单击 Yes(Yes)将上述代码添加到Windows Registry。
7.成功安装上述脚本后,您只需右键单击所需的任何文件或文件夹,然后从上下文菜单中选择“获取所有权”,即可轻松获取其(Take Ownership)所有权。(Ownership)
8.但是,您可以随时再次按照 1 到 4 的步骤卸载上述脚本,但这次使用以下代码:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[-HKEY_CLASSES_ROOT\dllfile\shell\runas]
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
[-HKEY_CLASSES_ROOT\exefile\shell\runas]
[HKEY_CLASSES_ROOT\exefile\shell\runas]
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="\"%1\" %*"
"IsolatedCommand"="\"%1\" %*"
9. 并保存名为Uninstallownership.reg 的文件。(Uninstallownership.reg.)
10.如果要从上下文菜单中删除“获取所有权(Take Ownership)”选项,请双击 Uninstallownership.reg( double-click on the Uninstallownership.reg)文件并单击“是”(Yes)继续。
方法 3:使用 3rd 方应用程序更改文件或文件夹的所有权(Method 3: Use 3rd Party Application to Change Ownership of A File or Folder)
在Take Ownership 应用程序(Take Ownership application)的帮助下,您可以轻松地获得所需的任何文件或文件夹的所有权,然后删除受TrustedInstaller保护的文件。该应用程序的工作方式与上述方法相同,但您只需要安装具有或不具有管理员权限的软件,(install the software with or without admin rights)而不是自己手动制作脚本。
只需安装Take Ownership应用程序,它将在Windows 10的右键单击上下文菜单中添加“ Take Ownership ”选项。
受到推崇的:(Recommended:)
我希望上述步骤能够帮助您在 Windows 10 中删除受 TrustedInstaller 保护的文件,但如果您对本指南或(Delete Files Protected by TrustedInstaller in Windows 10)TrustedInstaller服务仍有任何疑问,请随时在评论部分询问他们。
3 Ways to Delete Files Protected by TrustedInstaller in Windows 10
How to Delete Files Protected by TrustedInstaller in Windows 10: TrustedInstaller is a process of Windows Modules Installer which owns lots of system files, folders, and other programs. Yes, TrustedInstaller is the user account used by Windows Modules Installer service to own control to these protected system files and folders. And yes even if you’re administrator they are not owned by you and you can’t modify these files in any way.
If you try to rename, delete, edit these files or folders which are owned by TrustedInstaller you will end up getting an error message saying “You do not have permission to perform this action” and “You need permission from TrustedInstaller to make changes to this file or folder”.
Well, don’t worry in order to delete files protected by TrustedInstaller in Windows 10 you have to first take the ownership of the file or folder which you’re trying to delete. Once you have the ownership then you can grant full control or permission to your user account.
Can I delete the TrustedInstaller user account from file ownership?
In short, yes you can and it’s important that you don’t because TrustedInstaller user account is created to protect system files and folders, for example, if virus or malware attack on your PC then they won’t be able to modify system files or folders because these files & folders are protected by TrustedInstaller. And if you still try to delete the TrustedInstaller user account from file ownership, you will get an error message saying:
You can’t remove TrustedInstaller because this object is inheriting permissions from its parent. To remove the TrustedInstaller, you must prevent this object from inheriting permissions. Turn off the option for inheriting permissions, and then try again.
As easy may it sound but the process to take ownership of a file is a little longer but don’t worry that’s why we are here. In this article, I will walk you through the step by step guide on How to Delete Files Protected by TrustedInstaller in Windows 10 by taking the ownership of the file or folder back from TrustedInstaller.
3 Ways to Delete Files Protected by TrustedInstaller in Windows 10
Make sure to create a restore point just in case something goes wrong.
Method 1: Manually Take Ownership of Files or Folders in Windows 10
1.Open the file or folder for which you want to take the ownership back from TrustedInstaller.
2.Right-click on the particular file or folder and select Properties.
3.Switch to the Security tab then click on the Advanced button.
4.This will open the Advanced Security Settings window where you can see that the TrustedInstaller has the Full Control on this particular file or folder.
5.Now next to Owner name (which is TrustedInstaller) click on Change.
6.This will open the Select User or Group window, from where again click on the Advanced button at the bottom.
7.A new window will open, click on the “Find Now” button.
8.You will see all the user account listed in the “Search results:” section, select the user account from this list to make the new owner of file or folder and click OK.
9.Again click OK on the Select User or Group window.
10.Now you will be on Advanced Security Settings window, here checkmark “Replace owner on subcontainers and object” if you need to delete more than one file in a folder.
11.Click Apply followed by OK.
12.From the folder or file properties window, again click on the Advanced button under the Security tab.
13.No click on Add button to open the Permissions Entry window, then click on “Select a principal” link.
14.Again click Advanced button then click on Find Now.
15.Select the user account you selected in step 8 and click OK.
16.You will be again taken to the Permissions Entry window, from where you need to checkmark all the boxes under “Basic permissions“.
17.Also, checkmark “Only apply these permissions to objects and/or containers within this container” and click OK.
18.You will get a security warning, click Yes to continue.
19.Click Apply followed by OK, and again click OK on the file/folder properties window.
20.You have successfully changed the ownership of the file or folder, now you can modify, edit, rename or delete that file or folder easily.
Now you can easily delete files protected by TrustedInstaller in Windows 10 using the above method, but if you don’t like to go through this lengthy process then you could also use the below method to add “Take Ownership” option to the right-click context menu and easily take ownership of any file or folder in Windows 10.
Method 2: Take Ownership of Files/Folders in Windows 10 using Registry
1.Open Notepad file then copy and paste the following code into the notepad file:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\runas]
[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
[-HKEY_CLASSES_ROOT\dllfile\shell\runas]
[HKEY_CLASSES_ROOT\dllfile\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\dllfile\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
[-HKEY_CLASSES_ROOT\exefile\shell\runas]
[HKEY_CLASSES_ROOT\exefile\shell\runas]
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="\"%1\" %*"
"IsolatedCommand"="\"%1\" %*"
2.From Notepad menu click on File then select Save As.
3.From the Save as type drop-down select “All Files (*.*)” and then type the name of the file which can be anything you want but make sure to add .reg at the end of it (e.g. takeownership.reg) because this extension is very important.
4.Navigate to where you want to save the file preferably the desktop and click on the Save button.
5.Now right-click on the above file (Registry_Fix.reg) and select Install from the context menu.
Note: You will need an administrator account to install the script to Windows registry files.
6.Click Yes to add the above code to Windows Registry.
7.Once the above script is successfully installed, you can easily take the Ownership of any file or folder you want by simply right-clicking on it and then select “Take Ownership” from the context menu.
8.However, you can uninstall the above script any time you want by again following the steps from 1 to 4 but this time, use the following code:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[-HKEY_CLASSES_ROOT\dllfile\shell\runas]
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
[-HKEY_CLASSES_ROOT\exefile\shell\runas]
[HKEY_CLASSES_ROOT\exefile\shell\runas]
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="\"%1\" %*"
"IsolatedCommand"="\"%1\" %*"
9.And save the file with the name Uninstallownership.reg.
10.If you want to remove the “Take Ownership” option from the context menu, then double-click on the Uninstallownership.reg file and click on Yes to continue.
Method 3: Use 3rd Party Application to Change Ownership of A File or Folder
With the help of the Take Ownership application, you would be easily able to take ownership of any file or folder you want and then delete files protected by TrustedInstaller. The application works the same as the above method but you only need to install the software with or without admin rights instead of manually making the script yourself.
Just install the Take Ownership application and it will add the “Take Ownership” option in the right-click context menu of Windows 10.
Recommended:
I hope the above steps were able to help you Delete Files Protected by TrustedInstaller in Windows 10 but if you still have any questions regarding this guide or TrustedInstaller service then feel free to ask them in the comment’s section.