File lock detective work

There are eleventy billion little Windows shell extensions out there, but one that I find myself using at least a few times a week is the very directly named WhoLockMe.

When you can't delete (or move, or modify, but usually delete) a file in Windows, it's usually because some application has a lock on it. That's good, because it stops people from pulling the rug out from under running programs, but it's bad, because many processes maintain locks on files that they don't actually need any more.

Windows is not helpful about this problem - all it does is say the file or folder "is being used by another person or program", and suggest you close "any programs that might be using the file."

WhoLockMe lets you instantly see what processes have a grip on any file or directory. And yes, it's smart enough that you can ask who's locked a folder and it'll tell you, even though technically it's a file inside that folder that's locked.

You can even kill the listed processes, right from the WhoLockMe window.

Often, of course, WhoLockMe tells you that it's Explorer that has a lock (or two locks, or eighteen locks) on the file. That situation is unlikely to be resolvable without rebooting, or killing explorer.exe. Windows automatically restarts Explorer when you do that (you can make your computer much angrier than that if you try), but you lose all of your open folder windows and various System Tray stuff.

But it's still nice to know.

7 Responses to “File lock detective work”

  1. emrikol Says:

    I like Unlocker better. It just feels better for me.

  2. Daniel Rutter Says:

    Oooh, niiiice :-). Yep, that's definitely much more featureful than the old WhoLockMe. And, of course, much more able to freak out some program if you break the locks and zap the file/dir/whatever. But, y'know, More Power is good!

  3. Jaymis Says:

    Beat me to it emrikol. Unlocker rocks the monkey.

  4. VMax Says:

    Oooh. That was kind of broken. What I meant to say was, Handle and PsKill FTW! Because sometimes I get that "If I didn't type it, it didn't happen" kind of mood :)
    *prays to HTML-comment gods*

  5. evilspoons Says:

    I third Unlocker (second is a verb... is third?). Incredibly useful for deleting those lousy empty folders or whatnot that just won't go away.

  6. pjcamp Says:

    That's not entirely true.

    Process Explorer (from Sysinternals) will allow you to identify which process is maintaining an unnecessary handle on a file. You can then close the handle, even if the offending process is Explorer, without having to reboot Windows.


Leave a Reply