Unable to delete a file or take ownership on Win7x64
I'm a developer and as part of the build process, a Microsoft dll is copied to a certain folder. That file copy is now failing as the target can't be overwritten.
I decided to delete it by hand (using an admin account but a non-elevated explorer) so browsed to the folder and attempted a delete. This failed (Require permission from the Administrator). The same applies when using an elevated explorer.
So I tried Properties->Security->Advanced->Ownership
The current owner is showing as Unable to display current owner
. I can't take ownership (a simple Access Denied
message with no elaboration). Elevated Command Prompt/PowerShell don't help either (both give an Access Denied
in their own way).
Process explorer shows no open handles on the file.
Eventually, I booted to linux and deleted the file but what I'd like to know is what caused it?
Security Essentials had no issues with the file. It's digitally signed by MS and the signatures match.
I had this issue too for a file I manage with SourceTree ( git client ). This file had no 'Owner'. I just noticed that closing down all application susceptible to use it, removed it magically. The other option was to remove the file in windows' safe-mode. I don't know why this happened though and I'm curious too as to why this happened.
One solution works for me on Windows 7 :
Right click the hard disk drive, ==> Properties / Tools / Check now .... And then try to delete again, it should work.
In my case it was a file I'd used Firefox to download. Couldn't display owner, change ownership or delete the file (though it was readable). Using lockhunter to delete the firefox lock on the file worked.
I found that a folder with "Unable to display current owner" was locked as a library location (such as Music Library). I removed that as a Location and I could delete folder.