Finding which process has a file open

Sometimes it is useful to find which processes have a file open or locked to work out why the file cannot be accessed or deleted.

  • Note: Sometimes it is not the process itself doing the locking.

    It may be due to a third-party plugin (e.g. shell extension DLL or video codec/splitter) which has loaded itself into the host process.

    This just gives you a starting point in working out what's going on.

A good way to do this is using the Process Explorer tool from Microsoft. (Not to be confused with the similarly named Process Monitor tool, which is also useful but for different things.)

Here's what to do:

  • Download and unzip Process Explorer from Microsoft.

  • Right-click procexp64.exe and choose Run as administrator.

    ProcExp_0_RunAsAdmin-50%25

    (If you don't do this, and run it normally, it will potentially miss some processes.)

  • Within Process Explorer, choose Find > Find Handle or DLL... (or push Ctrl+F).

    ProcExp_1_Menu-50%25

  • Type the name of the file you are interested in. In the screenshot below, I'm looking for things that have prefx.oxc open.

    If you get too many matches, you can narrow things down by using a full path, or just click the list columns to sort by path.

    ProcExp_2_FindHandle-50%25

  • The Type column can be important at times.

    If you have been asked to check this information in another thread, posting a screenshot of the whole results list, or as much as possible, is usually best. You can resize the window if needed to show more.

    With the search results window active, push Alt+PrintScrn to put a screenshot of it into the clipboard, then go to the post editor here at the forum and use Ctrl-V to paste the screenshot into your post.

3 Likes