How to Find Programs Locking a File on Windows

So many times when we want to delete a certain file from the local storage drives on a Windows PC, it fails to delete the file citing that the file in question is in use by a certain process. Sometimes, the file could be in use by the system itself. In these cases, if you do not know which of the processes or application is using that file, how can you resolve the problem? We have to first find the application that is using the file and only then we can close that application to release the file.

In order to find the programs locking a file or using a file, we can use Microsoft Sysinternals’ Process Explorer. Here is how:

  1. First of all, you should note down the name of the file that is locked or in use. Full name of this file (name with extension) is going to be used later in these steps.Find Process Locking a File in Use
  2. Next you have to download Process Explorer from https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer.
  3. Extract the contents of the download ZIP archive, right-click on procexp.exe or procexp64.exe and choosse Run as administrator.
  4. In the Process Explorer window, press Ctrl+Shift+F to open the find window. Alternatively, you can also select FindFind Handle or DLL from the menubar.Find Process Locking a File in Use
  5. In the small Find window that opens, type the full name of the file that is locked and click Search. For example, we cannot delete apples.jpg, so we type in its name in the search box and click the Search button.Find Process Locking a File in Use
  6. In a few seconds, you will see the list of all the processes that are using your file. You can now use Process Explorer or Task Manager to terminate this process to free your file so that you can delete it.

This is the easiest method of finding the various processes that have your files locked or the applications that have been using your files.