How to Delete Files Protected by TrustedInstaller in Windows 10 and 11

·
4 min read

Help Desk Geek is reader-supported. We may earn a commission when you buy through links on our site. Learn more.

“You need authorization from TrustedInstaller in order to perform this action” – this error appears when you try to delete, rename, or edit a system-protected file in Windows 10 or 11. You’ll need to take ownership of the file and grant yourself Full Control before Windows will let you touch it.

⚠️ Before you start: Only use this method to remove malware or virus files that have embedded themselves in protected directories, or old Windows installation folders you’re certain are safe to remove. Do not use it to delete core system components like Windows Defender or anything inside System32 that will corrupt your OS. You also need an Administrator account to proceed.

Fix #1: Take Ownership and Delete the File Manually

This is the standard method that works on Windows 10 and Windows 11.

Step 1: Open the file’s Advanced Security Settings

  1. Right-click the protected file or folder and select Properties.
Windows 11 right-click context menu on a file with Properties highlighted
  1. Click the Security tab, then click Advanced at the bottom.
File Properties dialog on the Security tab with the Advanced button visible at the bottom

The Advanced Security Settings window opens. At the top, you’ll see the current owner listed as NT SERVICE\TrustedInstaller.

Advanced Security Settings window showing NT SERVICE\TrustedInstaller as the current owner, with the Change link highlighted

Step 2: Take ownership of the file

  1. Click the Change link next to the owner name.
  2. In the Select User or Group dialog, type Administrators and click Check Names. Windows will resolve it to your local Administrators group.
  3. Click OK.
Select User or Group dialog with "Administrators" typed in the text field and Check Names button visible
  1. If you’re targeting a folder that contains subfolders, check Replace owner on subcontainers and objects before clicking Apply.
  2. Click Apply, then OK.
Advanced Security Settings window showing Administrators as the new owner, with "Replace owner on subcontainers and objects" checkbox checked

The owner field should now show Administrators (or your account name).

Step 3: Grant yourself Full Control

  1. Close the Advanced Security Settings window and click OK to close Properties.
  2. Right-click the file or folder again and select Properties.
  3. Click the Security tab, then click Edit.
File Properties Security tab with the Edit button highlighted and Administrators listed in the Group or user names box
  1. In the Group or user names list, select Administrators. If it’s not listed, click Add, type Administrators, click Check Names, and click OK.
  2. In the Permissions for Administrators section, check the box next to Full Control. All other permission boxes will check automatically.
Permissions dialog with Administrators selected and Full Control checkbox checked under Allow column
  1. Click Apply, then OK, then OK again to close Properties.

You can now delete, rename, or edit the file normally. Right-click it and select Delete, no more TrustedInstaller error.

For folders with subfolders: propagate permissions to child objects

If you’re deleting an entire folder tree and the error keeps appearing on nested files, you need to push the permissions down to all child objects.

  1. Right-click the folder and select Properties > Security > Advanced.
  2. Click Change permissions at the bottom of the window.
  3. Select Administrators in the list and check Replace all child object permission entries with inheritable permission entries from this object.
  4. Click Apply and confirm the warning prompt.
Advanced Security Settings Permissions tab with "Replace all child object permission entries with inheritable permission entries from this object" checkbox checked and Apply button visible

This pushes Full Control down to every file and subfolder in one pass, so you won’t hit the same error on nested items.

Fix #2: Add “Take Ownership” to Your Right-Click Menu (Registry Tweak)

If you do this regularly, for instance, cleaning up malware remnants – navigating through Properties → Security → Advanced every time gets old fast. You can add a Take Ownership option directly to your right-click context menu via a registry modification.

  1. Press Windows + R, type regedit, and press Enter. Click Yes at the UAC prompt.
  2. Navigate to: HKEY_CLASSES_ROOT\*\shell
  3. Right-click shell, select New > Key, and name it TakeOwnership.
  4. With TakeOwnership selected, double-click the (Default) value in the right pane and set its data to Take Ownership.
  5. Right-click TakeOwnership, create another new key named command.
  6. Select command, double-click (Default), and set the value to:
cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F
Registry Editor showing HKEY_CLASSES_ROOT\*\shell\TakeOwnership\command with the Default value set to the takeown command
  1. Close Registry Editor. Right-click any protected file and you’ll now see Take Ownership in the context menu.

Clicking it runs both takeown and icacls in sequence, transferring ownership and granting Full Control in one step. After it completes, delete the file normally.

Note: This registry tweak applies to files only (HKEY_CLASSES_ROOT\*). To add the same option for folders, repeat the same steps under HKEY_CLASSES_ROOT\Directory\shell.

When These Fixes Don’t Work

If you’ve taken ownership and granted Full Control but the file still won’t delete, the file may be locked by a running process. Press Ctrl + Shift + Esc to open Task Manager, find any process associated with the file, end it, and try deleting again. If the file reappears after deletion, that’s a strong sign of active malware — run a full scan with Windows Defender or Malwarebytes before going further.

Conclusion

Fix #1 (the manual ownership transfer) handles this for the vast majority of cases. The registry tweak in Fix #2 is worth setting up if you find yourself doing this more than once as it cuts the whole process down to a single right-click. If a file keeps reappearing after you delete it, stop and run a malware scan first; the TrustedInstaller error is just the symptom, not the real problem.