Determining which Process is Locking a File

If you’re like me, every so often when working on Windows you get a message similar to the following:

(So the google can index this: “Cannot delete X: It is being used by another person or program. Close any programs that might be using the file and try again”)

You are trying to move or delete a file and some other program has it locked. Of course, Windows isn’t nice enough to tell you which program has it locked, so the process becomes one of experimental elimination. Try closing program after program until the file frees up, or if that doesn’t work, reboot the system and try again before starting any programs.

After this had happened to me several times in the same day, I got fed up and finally did a little research about tools that can give you some more useful information when this happens. This Google groups discussion gave some good resources that can be used to help out. The first option is one of the Sysinternals tools that was acquired by Microsoft. That tool chain can give you all sorts of great information, including which processes are holding which files.

The downside of Sysinternals is it’s a bit like killing a fly with a sledge hammer. Another alternative is the simple and elegant (yet slightly ghetto-sounding moniker) Who Lock Me. This tool adds an entry to the context menu in Windows Explorer that quite literally says “Who Lock Me”, and by clicking this entry it will list program(s) that are locking the file. I can’t vouch for the legitimacy of the tool. The website looks a little sketchy, but I have installed it on one virtual machine with no perceived ill-effects, and it did do what it advertised, so it seems to work. At least it tells you what Windows refuses to.

UPDATE:
I came across a site for an alternative to WhoLockMe, UnLocker that also listed alternatives of similar tools. Below is a list of the tools linked from the aforementioned page.

Tags:

One Response to “Determining which Process is Locking a File”

  1. Dusty says:

    I love it when you put ghetto-speak on your blog.

Leave a Reply