I have a folder which was generated by MSBuild,
app.publish. Often, my build script fails to delete it, complaining that it does not have the necessary permissions. Today I tested this outside of the build script, and found I could not even open it.
If I try to open it, I get this message:
"Location is not available. Access is denied."
So I tried to change the permissions, but could not even see who the owner was, even as an administrator:
So then I thought it might be a problem with Explorer, so I tried from PowerShell. Unfortunately, access is also denied there. I tried using
Get-ACE -Path app.publish, but that also refused to work: "Access is denied." I also tried
icacls app.publish /grant ijhbvhbv:f, but that too failed and said "Access is denied." I tried both of these commands both as my regular user, and as the administrator.
Finally, I tried to delete the parent directory, but was told I had to "provide adminstrator permission to delete this folder". When I did, I got a curious error: "You require permission from FWEE-ERIC-WIN8\ijhbvhbv to make changes to this folder". "FWEE-ERIC-WIN8\ijhbvhbv" is my own account. So it seems that I am indeed the owner of the folder, but only when I try to interact with it as the administrator.
Other questions about this on SU talk about UAC as a potential source of the problem, but the problem is the same no matter what UAC is set to.