I was running Vista with two NTFS partitions (OS and DATA), then formatted the first partition and installed Windows 7 RC. The second partition (DATA, drive D) had some security attributes on some files and folders. After I installed Windows 7, some files on drive D were not accessible anymore and I was getting “Access Denied” errors. I tried to right-click on the folders that were not accessible and changed their owner and adjusted permissions but still some folders were inaccessible no matter what I did. Just before giving up, I remembered that since Windows NT, there was a tool named “cacls” that allows to display or change ACLs (access control lists). Since Windows 7 it’s named “icacls”.

To reset files permissions:

  1. Run “cmd” as Administrator

  2. Go to the drive or folder in question, for example:

    CD /D D:
    
  3. To reset all the folder/files permissions, type:

    icacls * /T /Q /C /RESET
    

And that’s it! After that, the file’s permissions were reset and I can access them again. cacls is a handy tool to change permissions on files and folders.

Reference: http://support.microsoft.com/kb/318754