Lars Nielsen's Discoveries

September 2, 2011

Remove a lock on a file without rebooting

Filed under: Application,Troubleshooting — Lars Nielsen @ 6:51 pm
Tags: , ,

I often used the superb range of tools from SysInternals created by Mark Russinovich.  I first heard about Mark when he exposed the Sony Rootkit copy-protection scandal.  It’s perhaps ironic that Sony, a company that once attempted to infect everyone’s PC with a rootkit to prevent them copying CD’s, should now be the subject of almost weekly security breaches of its own.

Anyway, one of the SysInternals tools I use most is Process Explorer.  This tool is a great way to see what’s going on with the RAM in your system and which processes are most resource-heavy.  One handly use for Process Explorer is when you have a file that’s locked for some reason and you can’t delete or move it.  This can happen, for example, with text files that are not closed properly by an application, or a DLL that’s locked by a service process.  Using Process Explorer, you can search for a file by filename, and it will find all the processes that have a handle onto that file.  If the process is a service, then restarting the service will probably release the lock.  If it’s another process, you might need to kill it to release the lock.  After that you should be able delete, move, or rename  the file in question.


1 Comment »

  1. Brilliant! Thanks 🙂

    Comment by Rob — June 27, 2012 @ 1:51 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: