Changing File Ownership In Vista and Longhorn
While installing Notepad2 on my Longhorn box (WindowsServer2008) I ran into an issue with overwriting the original notepad due to a lack of permissions. I found Matt Berther’s article which helped me understand what files needed to be overwritten for use in Vista. While I ran into similar problems in Vista, I did not write down my steps, so when it came time to rebuild my Longhorn development environment, I battled the same issues.
Vista and Longhorn both have increased security measures. Overwriting a system file like notepad.exe is more involved. While I can see their need for this added security, I do find it annoying. Regardless of whether or not you are installing Notepad2, as in this article, or you just need to reassign ownership of a file in Vista or Windows Server 2008, I hope this article helps alleviate some of the pain.
In following the article on overwriting notepad.exe with notepad2.exe, I first came across the issue of granting full control rights for this file to my logged in user. Since I have had to figure this process out more than once now, I am deciding to document it, with wonderful screen-shots.
While granting full control to the administrator, I was alerted with the following dialog.
In order to overwrite a file, like notepad.exe, we need to give the administrator "Full control." In order to do this, we need to change ownership of the file from "TrustedInstaller" to "Administrators." TrustedInstaller, by default, has full control, while the admin account does not.
Right click the target file, click Properties.
Click on the security tab. You should see the "Administrators" account, by default, with read and execute permissions only.
Click on the "Administrators" account, seen above, then click on "Advanced" as pictured below.
Next, we need to select the account for which we wish to edit owner permissions. Select the "Owner" tab. We should see "TrustedInstaller" highlighted as the current owner.
Click the "Edit…" button to change the owner of the file. The owner settings dialog should appear. Select the "Administrators" account, and click "Apply." After clicking apply, there should be a prompt as shown below.
Finally, click "OK." Then click "OK" to close the owner dialog. Click "OK" to save and exit the "Advanced Security Settings for <YourFileName.extension>."
Next, we want to allow "Full control" for the admin account. After closing the last dialog, we should still see the properties dialog for our file (the original dialog view, the second screen-shot in this series). Select the "Administrators" account, and click "Edit."
Give our "Administrators" account full control by enabling the checkboxes.
When you click "Apply" to apply these changes, the following prompt should be displayed. Click "Yes" to apply these changes to to grant full control to the administrator account.
At this point, the ownership of this file should have changed from the default "TrustedInstaller," to the "Administrators" group. For me, I can now overwrite this notepad.exe file with the more useful notepad2.exe.
I hope this article helps. Until Vista and Longhorn become second-nature, I know I will be referencing this.
Filed under: Uncategorized





[...] See the original post here: Changing File Ownership In Vista and Longhorn [...]