Windows – How to force deletion of a file on Windows 7

file-permissionswindows 7

I opened a file using Vim from MinGW's MSYS on Windows 7, and it crashed, and it's left behind a .filename.swp file which I cannot delete! I'm in the local admin group, and I tried following this, in an administrator command propmpt, and that didn't work. Nor did logging on as the local admin and performing the same actions. Any suggestions?

Update:
From the console I get: "ERROR: Access is Denied" when executing takeown /f .filename.swp as an Administrator.
When going through Right Click->Properties->Security, it comes up with something I've never seen before saying: "You do not have permission to view this object's security properties. To view it's security properties you can try taking ownership of the object…"
When I do try, I get the same, unhelpful message: "Access is Denied".
The only other interesting thing I can see is that under the "Current Owner" field it says:
"Unable to display current owner.".

Best Answer

I always try to use an application called Unlocker first. This will attempt to unlock any restrictions currently on the file.

If that fails, then it sounds like you're basically locked out from doing anything in Windows. I would consider using some type of Live CD that will let you boot to a temporary OS and access your disc to delete the file.

Related Question