Im sure you have all experinced the hassle of having a file lock stop you from completing a task, whether it be deleting a folder or something more complex like performing a software upgrade. Last week i had this very issue, while trying to upgrade an EPiServer website from one version to another the process kept failing and rolling back bacause one of my files was locked by another application. Like most people presented with this problem I followed a basic procedure for unlocking the file, including restarting IIS and cycling the .net worker process, alas to no avail. As I did not want to go through the hassle of closing all my applications and restarting my PC i asked JD if he had any way of determining which process was causing a lock. Lucky for me he did have a solution and recommended Unlocker an application written by Cedrick Collomb.  This little tool, once installed, sits in the background and allows you to view the locks on any file using an option on the context menu.

Obviously unlocking files randomly can cause all sorts of problems so this tool should be used with a little caution, however in my case Unlocker informed me what application had the lock and i was able to close the application myself rather then forcing a break. Incidently my problem turned out to be Visual Studio 2003, I had closed the project but left the application running, for some reason the file lock had not been released.

2 Responses to “Locked Files?”

Yes, Visual Studio will do that. And the 2005 version is even worse. My guess is that intellisense is part of the problem.

Just check your %appdata%\Microsoft\VisualStudio\8.0\ReflectedSchemas\ directory to see what VS does behind the curtain, to make our lives easier.

Btw. cool tool! “wholocksme” is out the door.

Damn, I thought you were going to tell me what to do when a file is in use by another user and they’ve gone out for the afternoon and locked their keyboard. Rargh!

Something to say?