Unlocking files that are in use on Windows


To totally unlock this section you need to Log-in


Login

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.

NOTE: closing handles might cause data inconsistency, crashes, loss and/or other undesirable effects. Make sure you understand what you’re doing before you do it.

Unlocking files that are in use on Windows

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 SysInternals.

Download the Process Explorer tool. Execute procexp.exe and then choose Find > Find Handle or DLL option:

Unlocking files that are in use on Windows

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

Unlocking files that are in use on Windows

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

Unlocking files that are in use on Windows

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.

What is an handle?

In computer programming, a handle is an abstract reference (or "address") to a resource. Handles are used when application software references blocks of memory or objects (like files) managed by another system, such as a database or an operating system.

It's like a pointer, but not a pointer in the sence that it's not a memory address that could be dereferenced by user code to gain access to some data.

A handle is like a primary key value of a record in a database: a primary key uniquely identifies a database record, and a handle in the Windows system uniquely identifies a window, an opened file, etc.