Windows用户遇到需要特殊权限的错误并不少见。例如,如果您曾尝试删除核心系统文件,您可能会遇到“文件夹访问被拒绝(Folder Access Denied)”提示,“您需要 TrustedInstaller 的许可才能更改此文件夹。(You require permission from TrustedInstaller to make changes to this folder.)”
这可能会让您感觉自己无法完全控制,但Microsoft添加了NT SERVICE\TrustedInstaller帐户来保护您的系统。
什么是 TrustedInstaller?
TrustedInstaller是Microsoft在(Microsoft)Windows Vista中引入的Windows 资源保护(Windows Resource Protection)的核心组件。此外,Windows Modules Installer服务使用TrustedInstaller帐户来添加、删除或修改Windows更新和其他组件。
删除或修改TrustedInstaller拥有的文件或文件夹可能会阻止您的Windows安装正常运行。将其视为另一种保护措施,甚至可以防止管理员帐户删除核心Windows文件。但是,有时您可能需要修复或修改损坏的系统文件,为此您需要TrustedInstaller权限。
如果您确信您正在做的事情是安全的,您可以从TrustedInstaller获取这些文件的所有权。不过(Nevertheless),以防万一,创建系统还原点(create a system restore point)始终是一个好习惯。
从TrustedInstaller(TrustedInstaller)取得所有权
从TrustedInstaller(TrustedInstaller)获取所有权有两种方法。
使用高级安全设置(Using the Advanced Security Settings)
这是获得文件夹所有权的一种漫长但用户友好的方式。
- 使用文件资源管理器导航到文件夹。
- 右键单击(Right-click)该文件夹并选择Properties。
- 导航到安全(Security)选项卡并选择右下角的高级。(Advanced)
- 将打开一个新窗口,您将在其中看到TrustedInstaller作为文件夹的所有者。选择更改(Change)以更改所有者。
- 现在,Windows 将要求您输入要选择的对象名称(Enter the object name to select)。输入要将所有权转移到的用户名。
- 单击检查名称(Check Names )以完成完整的对象名称并选择确定(OK)。
- 当您返回到Advanced Security Settings窗口时,您会在(Advanced Security Settings)Owner名称下方看到一个新复选框,其中显示Replace owner on subcontainers and objects。选中此框以转移所有子文件夹和文件的所有权。
- 单击确定(OK)关闭窗口。然后,通过选择Advanced(Advanced)再次打开窗口。
- 从窗口左下方选择更改权限。(Change permissions)
- 选择添加(Add)。这将打开一个新窗口。
- 单击从顶部选择主体并重复步骤 5 和 6。(Select a principal)
- 选中基本权限(Basic permission)下完全控制(Full control)旁边的框,然后选择确定(OK)。
- 应用(Apply)更改并按OK。
执行这些步骤将使您拥有该文件夹的所有权,并且您将不再需要TrustedInstaller的许可来对其进行更改。
使用命令提示符(Using Command Prompt)
如果您知道如何使用命令提示符(how to use the Command Prompt),则可以比以前的方法更快地转移所有权。
- 首先(Start)按照以下步骤打开提升的命令提示符。
- 在开始菜单中搜索cmd 。
- 右键单击命令提示符(Command Prompt)
- 选择以管理员身份运行(Run as administrator)。
- 运行以下命令:
TAKEOWN /F “C:\Program Files\Internet Explorer”
当然,更改要为其转移所有权的文件夹的路径。
- 如果一切顺利,您会看到一条消息,告诉您您已成功转移所有权。
您现在可以随意修改或删除 Windows 文件夹(remove Windows folders)。但请始终确保您不会删除任何会阻止Windows正常运行的关键组件。
TrustedInstaller Permissions: How to Add, Delete, or Change System Files
It’s not uncommon for a Windows user to come across an error that requires special permissions. For example, if you’ve ever tried to delete core systеm fіles, you likеly came across a Folder Aсcess Denied prompt that reads, “You require permission from TrustedInstaller to make changes to this folder.”
This might make you feel like you’re not in total control, but Microsoft has added the NT SERVICE\TrustedInstaller account to protect your system.
What is TrustedInstaller?
TrustedInstaller is a core component of Windows Resource Protection that Microsoft introduced with Windows Vista. In addition, the Windows Modules Installer service uses the TrustedInstaller account to add, remove, or modify Windows updates and other components.
Deleting or modifying files or folders owned by TrustedInstaller may prevent your Windows installation from running properly. Think of it as another safeguard that prevents even an administrator account from deleting core Windows files. However, sometimes you may need to fix or modify corrupt system files, for which you’ll require TrustedInstaller permission.
If you’re confident that what you’re doing is safe, you can take ownership of these files from TrustedInstaller. Nevertheless, it’s always a good practice to create a system restore point, just in case.
Take Ownership from TrustedInstaller
There are two methods of taking ownership from TrustedInstaller.
Using the Advanced Security Settings
This is a long, but user-friendly way to gain ownership of a folder.
- Navigate to the folder using file explorer.
- Right-click on the folder and select Properties.
- Navigate to the Security tab and select Advanced at the bottom-right corner.
- A new window will open where you’ll see TrustedInstaller as the owner of the folder. Select Change to change the owner.
- Now, Windows will ask you to Enter the object name to select. Enter the user name you want to transfer the ownership to.
- Click Check Names to complete the full object name and select OK.
- When you return to the Advanced Security Settings window, you’ll see a new checkbox right below the Owner name that reads Replace owner on subcontainers and objects. Check this box to transfer the ownership of all subfolders and files.
- Click OK to close the window. Then, open the window again by selecting Advanced.
- Select Change permissions from the bottom left of the window.
- Select Add. This will open a new window.
- Click on Select a principal from the top and repeat steps 5 and 6.
- Check the box beside Full control under Basic permission, and select OK.
- Apply the changes and press OK.
Performing these steps will give you ownership of the folder, and you will no longer require permission from TrustedInstaller to make changes to it.
Using Command Prompt
If you know how to use the Command Prompt, you can transfer ownership much faster than the previous method.
- Start by opening an elevated command prompt following the steps below.
- Search for cmd in the Start Menu.
- Right-click on Command Prompt
- Select Run as administrator.
- Run the following command:
TAKEOWN /F “C:\Program Files\Internet Explorer”
Of course, change the path to the folder you want to transfer ownership for.
- If all goes well, you’ll see a message telling you that you’ve successfully transferred ownership.
You can now go ahead and modify or remove Windows folders as you please. But always ensure that you don’t remove any critical components that will prevent Windows from functioning properly.