Unlocking the Locked Files Locked in Windows 7 and 8

Locked files are annoying, especially those locked in mystery as to no reason why they are locked and what has been holding them off. You often ended up closing all your opened applications and rebooting your computer to clean up the locked handles so that you can deal with these files.

There are a few reasons why your file may have been caught in locked position. For one, the file might be opened by another user on the same network because the file is part of the shared folder on your computer. And another, the file may be opened and locked by an application that is still actively alive in the background even though it’s been closed by the user.

To unlock a file locked by a remote user

Note that if your computer doesn’t have a shared folder that is accessible to the remote user, you won’t be able to unlock a file by this method.

1. Open Computer Management, by right-clicking My Computer icon and choosing Manage.

image

On Windows 8, you can right-click the Start button to bring up the Power Menu and launch Computer Management straight from there.

Windows 8 - Computer Management

2. Expand Shared Folders, and click on Open Files at the left hand panel in Computer Management.

image

3. Then on the right side panel, find the file that is opened by a remote user, right-click on it and choose Close.

4. After that, you will be able to deal with the file that was locked before.

To unlock a file locked  by an application

Sometimes I called these locked files in mystery because often times you found there is just no reason for them to be in the locked mode and you certainly don’t see any running applications that were holding them off.

If you know the name of the application that had been used to open the file before, you may want to check the Task Manager (Ctrl+Shift+Esc) to see if the application that you had closed is still alive in the Processes tab. If so, manually killing it in Task Manager would release the lock handle so that you will be able to deal with the file again.

However, in a lot of cases, you might not have idea of which application you should be looking or the file still remains in locked even after you manually terminated the application described above. If that’s the case, it’s time to call up a help for the 3rd party tool. Among many of them out there, Unlocker is one that is free and portable, and that I have been using for years. I am always quite happy with the output from this extremely tiny but effective tool.

Interestingly, Sysinternals also has a tiny command line tool called Handle that displays information about all or specific open handles for any process in the system. You can use it to see the programs that have a file open. And you can terminate the specified handle to release the locked file.

Handle requires a local admin to run so you will need to open Command Prompt as Administrator first and run it inside.

First, if you don’t know which handle that holds off your file, use the name switch to find out all handles and their IDs. For example, I can use the following command to find out which applications are currently running to access my Desktop.

handle %userprofile%\desktop

Handle - 2014-11-07 12_05_23

Then, I can see it’s AcroRd32.exe with pid 9328 that is holding off my file. Then, I can use the following command to terminate the process to release the handle.

handle -c 9328

There is also a GUI version of Handle, called Process Explorer, that you can try out if command line tool is a bit too much to handle for you.

That’s about it. Hope it helps.

Kent Chen

Microsoft MVP, IT Professional, Developer, Geek, and the co-founder of Next of Windows.

Last updated: 11/07/2014

Posted in: Tips & Tricks , Tools
Discover more: , , ,

Leave a Reply

Notify of
avatar
Samthammel
Guest

I think an easy way to look for locked file handles is by using “Process Explorer” from Microsoft:
http://technet.microsoft.com/en-us/sysinternals/bb896653

I already use it as an task manager replacement. So you start it (By CTRL-SHIFT-ESC), get admin rights and do a CTRL-F for the locked file name. There you can close this file handle by force without killing the hole application.

Tytrate
Guest

I have had problems with file be lock.  It turned out that the file were set to read-only because Carbonite had them queued for backup.  Normally not a problem, unless you have a large number of files pending backup and the locked file is at the end of the queue.

In the case of Carbonite:

1.  disable (not pause) Carbonite
2.  perform operation on the file
3.  enable Carbonite

Regards,

Richard

mfp2waoe
Guest

Can someone translate this to English?

Ricardo Zea
Guest

Carbonite was locking my files left and right, with EMCO UnLock IT I was able to unlock them. Carbonite SO sucks. Thanks for the info Kent.

http://emcosoftware.com/unlock-it

wpDiscuz
Today's Top Picks for Our Readers:
Recommended by Recommended by NetLine