Deleting Protected Directories in Windows 8.1

I recently re-purposed an SSD from being my primary hard drive into a second hard drive, but didn't reformat it.  As a result, when trying to clean up the drive, I ended up with error messages when I tried to delete the Windows, Program Files, ProgramData, and Program Files (x86) directories:

Folder Access Denied

You require permission from TrustedInstaller to make changes to this folder

You require permission from SYSTEM to make changes to this folder

Folders owned by TRUSTEDINSTALLER or SYSTEM can't be deleted even by an administrative account.  The solution is to take ownership of each folder prior to deleting it.  It's not the most intuitive workflow in the dialogs, however, so this blog post will walk through how to do it in the most recent version of Windows 8.1 as of this writing.

1. Right click on the folder and select "Properties" to bring up the properties dialog

2. Select the "Security" tab

3. Click "Advanced" to bring up the Advanced Security Settings dialog

4. Click "Change" next to Owner

5. Set yourself as the owner, and click OK

6. Check the "Replace owner on subcontainers and objects" checkbox, and click "Apply"

7. Finally, re-check the "Replace all child object permission entries with inheritable permission entries from this object" (for some reason, even if this was checked before it needs to be reapplied)

Now you should be happily able to delete the folders and clear off lots of disk space.

No Comments