Saturday, April 14, 2012

Deleting Files From Old ProgramData Folders

Last year a piece of software corrupted the Windows 7 installation on my primary desktop system, and I had to re-install Windows. I ended up putting Windows on a different hard drive so I could preserve the data that was already on the original drive. I thought I had cleaned out all the remnants of the initial Windows installation, but this morning I discovered there was still a hidden ProgramData folder on the old drive. I knew I didn't need it anymore (all of the files inside were well over a year old), so I attempted to delete it- but was annoyed to get a File Access Denied dialog box with a message that said, "You need permission to perform this action."

It was really two specific files that were causing the problem, MpScanCache-1.bin and MpScanCache-2.bin. They are apparently cache files created by Microsoft Security Essentials. It took about 15 minutes to figure out what to do, but I finally managed to delete the files. Here's how:
  1. First, we have to take ownership of the file. Right-click the file in Explorer and then click Properties.
  2. On Security tab, click Advanced.
  3. On Owner tab, click Edit.
  4. Click Other users or groups.
  5. Type your Windows user account name under Enter the object name to select, and then click Check Names. If the name you entered checks out, click OK.
  6. Click OK again. You will be prompted with a Windows Security dialog that says you need to close the file properties. Click OK, then OK, then OK, then OK to close all properties windows.
  7. Now we have to change the file's permissions. Right-click the file in Explorer again and click Properties.
  8. On the Security tab, click Edit.
  9. Click Add.
  10. Type your user account name under Enter the object name to select, and then click Check Names. If the name you entered checks out, click OK.
  11. Now, select your user account in the Security tab and then click Full control under Allow in the lower window labeled Permissions for (username), then click OK.

    Note
    Do NOT check any options under Deny.
     
  12. Click OK again.
  13. Delete the file and rejoice!

No comments: