We’ve all experienced it sometime: A file or folder is in use, and windows refuses to move or delete it. Even though it should, Windows rarely shows us what or who is blocking the file. Left in the dark, you’ll end up closing all sorts of apps, killing explorer, and what not. Then there are those cheesy apps, like “who’s blocking”, that do all but free the file. So.. there we are.
A few days ago, I stumbled upon a small command line app from Mark Russinovich. Now, that sounds like a guy who knows how to kill a blocking app. 😉 (just kiddin’). In fact, his app called “handle” is featured at Windows Sysinternals. Here is what it did for me.
I had this demo of Mixmeister and I wanted to “move” the downloaded install-file-folder to my backup drive. But somehow it was blocked. Windows, endlessly informative, told me nothing that I could use:
So I fired up HANDLE. I asked it to tell me who’s blocking Mixmeister.
I then got a list of “handles”, two of them were explorer and one of them was my browser chrome. To chase these apps away from my folder (file), I needed the PID of the app and the handle on the file. Handle provides both. In my case, explorer had pid 3796 and the handle on my folder had 1978. I could now get it off by entering:
Handle -c 1978 -p 3796
I did the same for the other two handles, and see there: The folder was free and I could move it quite happily.
Just remember: Killing handles “can” crash your machine. When attempting this, always make sure any unsaved data is saved!