Unlocking files that are in use

Sometimes you cannot delete or rename a file that is currently in use. You might receive an access violation error, or simply a message telling you that your action could not be completed because the file is open in another program.

image

You may have already come across the Unlocker freeware tool that lets you "unlock" files that are in use by some application.

Here is another way (let’s call it the ‘techie’ way) to unlock files that are in use. It makes use of the Process Explorer tool from Windows SysInternals.

  • Download the Process Explorer tool. Execute procexp.exe
  • Choose Find > Find Handle or DLL option

image

  • Type the name of the file you want to unlock and hit Search.

image

  • The process EXE locking the file and the path to the file are listed. Double click on the result.

image

  • The file handle will be highlighted. Right-click on it and choose Close Handle.

Your file is now unlocked and can now be deleted, moved or renamed.

A little disclaimer here, closing handles might cause data inconsistency, loss and/or other undesirable effects. Make sure you understand what you’re doing before you do it.




Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • HelloTxt
  • LinkedIn
  • Live
  • MySpace
  • RSS
  • StumbleUpon
  • Technorati
  • Twitter
This entry was posted in Uncategorized and tagged , , , , , , . Bookmark the permalink.

6 Responses to Unlocking files that are in use

  1. EhabT says:

    me no like the ‘techie’ way…
    i preffer the ‘easy’ way …
    just use KillBox from
    http://www.killbox.net
    easy to use, no installation (i have it on my flash drive everywhere i go) and best thing, it can kill any file or any process with 2 clicks (literally)

    cheers
    EhabT

  2. Roger Pack says:

    use unlocker and right click on it :)

  3. David says:

    This was GREAT… cause when I ran it on 2003 srvr at work, and typed in the name of the file after clicking on find, it locked up the entire server so badly even a ctrl-alt-del wouldn’t work.

    Hit the big red switch…

    So, way to go, Microsoft! Thanks for the helpful tip!

    • Shijaz says:

      Hi David,

      Of course you understand that this is a personal blog and not affiliated or maintained by Microsoft in any way. Read the disclaimer.
      The Unlocker tool here is also not from Microsoft. It is a third party tool!

      Thanks :)

      Shijaz

  4. Chandra says:

    Wow, Good I trying to delete the file that is in use. I downloaded ProcessExplorer but dont know how to use the tool. Your article helped me a lot. Anyway Thanks !!!!!!!!!

  5. sm says:

    tried unlocker on a file, though it unlocked the haldes, couldnt delete still. tried this and it did.

    if you cant follow the instructions after downloading process exp you should not be near a computer.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>