After changing the ownership of a system folder, it is better for security to restore the original TrustedInstaller as the owner. Here's how.
By default, all most all the system files in Windows will have TrustedInstaller as their owner. As you can tell from the name itself, TrustedInstaller is very different from your regular standard or admin account. The TrustedInstaller is a system user that is fully managed by Windows in the background. In fact, most system operations like managing Windows updates and things like that are performed by TrustedInstaller. You will not see it in the regular Windows users list.
The files with the TrustedInstaller as their owner are protected with special permissions to restrict unwanted changes. If you try to access or modify the protected files, you will receive file access denied error.
Generally, you will never have to touch or even know about the file or folder ownership. However, there might exceptions and situations where you need to modify the files or folders owned by TrustedInstaller. In those cases, you can simply change the file ownership and go on with your modifications.
Once you are done with your work, it is important that you restore the TrustedInstaller owner for that file. Otherwise, you or other users or even programs might inadvertently modify or delete the file. Thankfully, it is pretty easy to restore the original TrustedInstaller owner in Windows. Let me show you how.
The steps below can also be followed by Windows 7 and 8.
Steps Restore TrustedInstaller Owner
Before proceeding, I recommend you create a system restore point just to be on the safe side. Once you've done that, follow the steps below.
1. First, go the file or folder for which you want to restore the ownership. Now, right-click on it and select "Properties".
2. In the properties window, go to the "Security" tab and click on the "Advanced" button.
3. In the Advanced Security Settings window, click on the "Change" link appearing next to "Owner".
4. In the big blank field, type "NT Service\TrustedInstaller" and click on the "Check Names" button.
5. The above action will find the TrustedInstaller user and add it to the field. It will appear as "TrustedInstaller" in the field. Click on the "Ok" button to confirm the user.
6. In the Advanced Security Settings window, you will see that the owner has changed to TrustedInstaller.
7. (optional - 1) While taking ownership, ff you've also given yourself full user permissions over the file or folder then select your user account and click on the "Remove" button. If you are not sure then just ignore this step.
8. (Optional - 2) If you are modifying permissions of a folder, you might also want to select both "Replace owner on the subcontainers and objects" and "Replace all child object permission entries with inheritable permission entries from this object" options. These options will not be visible for just files.
9. Click on the "Apply" button.
10. If you see a warning or information window, click on the "Ok" button to continue.
11. The above action will change the ownership back to TrustedInstaller. Once that is done, you will see "TrustedInstaller" next to "Owner".
12. Close all windows.
That is all. You've successfully restored TrustedInstaller as the owner of the given file or folder. Keep in mind that you can only do this one folder or file at a time. Bulk changing ownership is not possible. So, if you have multiple files, you have to follow the same steps for each and every such folder or file.
Hope that helps. If you are stuck or need some help, comment below and I will try to help as much as possible.