Take the 2-minute tour ×

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.

share|improve this question
possible duplicate of File I can't take ownership of –  CharlieRB Oct 16 '12 at 14:12
@CharlieRB I've read it - but as you can see, my problem isn't removing the file but understanding what the "loss of ownership" is caused by. –  Basic Oct 16 '12 at 14:23
You are right. Sorry. Guess I got lost in reading it and misunderstood the question. –  CharlieRB Oct 16 '12 at 14:35
In some cases, deleting a file needs to be done externally, e.g. Safe Mode, or as you did booting into another OS. If the file has certain attributes (I'm not exactly sure but I think System affects it), along with the existing SYSTEM permissions, that makes it untouchable in the context of the booted Windows. Obviously once you go away from that context, it becomes irrelevant, but inside Windows 7 (and 8) some files are certainly undeletable. –  Randolph West Oct 16 '12 at 16:05
@RandolphWest Thanks for the answer. Can you explain a little more? I know anything with an open handle can't be modified but suspect that if I deleted everything I could in my windows dir then rebooted, I'd have bricked my machine - so there's no "required for windows" flag set on a lot of files. Pagefile/etc come under the heading of open handles. I just don't see how a DLL buried in a folder on my D drive which has been replaced every few hours for days can suddenly be flagged as undeletable (nor what that "flag" is?) –  Basic Oct 16 '12 at 16:39
show 1 more comment

3 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Open command prompt with admin rights, then type:

net user administrator - this will display current settings.

Use net user administrator /active:yes to activate if needed.

This is the built-in administrator account for managing the system. It is usually not active.

share|improve this answer
Thanks for the tip but if it was owned by the local admin account, 1) wouldn't another admin be able to take ownership and 2) wouldn't the security dialog have identified the owner? It was my understanding that only the SYSTEM account had higher permissions than a user in the administrator group –  Basic Oct 16 '12 at 14:27
Your understanding is correct, @Basic. –  Randolph West Oct 16 '12 at 16:06
add comment

Your Answer


