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:
- 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.
- Next you have to download Process Explorer from https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer.
- Extract the contents of the download ZIP archive, right-click on procexp.exe or procexp64.exe and choosse Run as administrator.
- In the Process Explorer window, press Ctrl+Shift+F to open the find window. Alternatively, you can also select Find → Find Handle or DLL from the menubar.
- 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.
- 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.