Two ways to solve the problem
- Command Prompt
- File Explorer
Command Prompt
- Run Command Prompt as Administrator
- Enter TAKEOWN /F and then type the file or folder name.
TAKEOWN /F C:\Windows\System32\TestFolder\deleteFile.dill
- Press Enter to take control of the file.
- Enter the following command to immediately give your user account permission to delete or change the file or folder:
icacls C:\Windows\System32\TestFolder\deleteFile.dill /grant Administrators:F /T
- Edit the File’s Security Options to Fix the TrustedInstaller Error
File Explorer
If you are not comfortable with Command Prompt try with File Explorer.
- Right-click on the file or the folder you want to delete and then choose Properties.
- Now go to the Security tab.
- Select a Group or user name and check permissions. You can select Administrators or Users.
- You have to make the permission Full control. To change permission
- First change Ownership
- To change ownership, click on the Advanced button. Then click on the blue color Change link. From the popup box, click on Advanced… and then find and select a user. Check Replace owner on subcontainers and objects and Replace all child object permission entries with inheritable permission entries from the object and click on OK.
- Then edit permission
- To change permission, click on Edit
- Now change permission to Full control
- Click OK.
- First change Ownership
- Now you can delete the file or the folder.