Finding out which process is locking a file or folder in Windows? Or Deleting a locked file in windows!

 

This is really an annoying condition. It happens many time, while in MS word, or if you open a file from your personal web server, a folder you are working on or file you just closed. It could be any of these or due to some unknown reason, the folder/file get locked and it gets difficult to delete or rename the folder or file.

image

This happens due to a simple reason – some of your software, process, thread is using it and yet not finished closing it. Every open file is being assigned with a numeric file handle by OS, so that a process or software can identify it. What we need simply is to find out which software or process “File Handle” is using our file or folder.

Normally this is not easy, but Microsoft had made this really easy for us. Microsoft has created a software suit called “Windows Sysinternals” for IT pro and System administrators. This suit consists of various tiny but powerful software tools to manage, troubleshoot and diagnose your Windows systems and applications.

You can download the entire Suit at:

http://technet.microsoft.com/en-us/sysinternals/bb842062

or any single utility at:

http://technet.microsoft.com/en-us/sysinternals/bb545027

What we need today for our problem is “Process Explorer”, which can be downloaded from:

http://technet.microsoft.com/en-us/sysinternals/bb896653

Download and Run “procexp.exe” tool from there.

image

It will take some time to populate all running process.

Look for the find tool in toolbar or menu bar.

image

Open this find handle or DLL box to search for the blocking handle.

image

In this find box just type the exact name of file or folder is being locked.

The search utility will find the handle for process or software that were using or opened your file. Click on the search result to see detail in lower pan of main window.

image

In this case it was notepad opened a handle to my file preventing me from deleting the file/folder.

image

Right click on the file handle entry and just select Close Handle.

image

And yes this is really important! You must be aware of what you are closing.!

Click yes to go ahead!

Now you are free to rename/delete/move or edit your file/folder.


Leave a comment