How to Find Out Which Windows Process is Using a File

Ever try to delete, move, or rename a file only to get a Windows system warning with something like one of these messages?

  • "Cannot delete file: Access is denied"
  • "There has been a sharing violation"
  • "The source or destination file may be in use"
  • "The file is in use by another program or user".
  • "Make sure the disk is not full or write-protected and that the file is not currently in use"

One of the best ways to handle locked files or folders is to use the free Microsoft program Process Explorer. The program has been described in another article and here is how to use it to find out what program, DLL, or handle is using a file or folder. You will need to run as administrator.

How to find out what program is using a file

In Windows 7 or 8, the system message may tell you what program is using the file. If it doesn’t or if you are using Windows XP, there is a simple way to find the program:

  1. Open Process Explorer, running as administrator.
  2. On the toolbar, find the gunsight icon on the right (shown highlighted in the figure shown below).
  3. Drag the icon and drop it on the open file or folder that is locked.
  4. The executable that is using the file will be highlighted in the Process Explorer main display list.

How to find out which handle or DLL is using a file

  1. Open Process Explorer, running as administrator.
  2. Enter the keyboard shortcut Ctrl+F. Altenatively, click the “Find” menu and select “Find a Handle or DLL”.
  3. A search dialog box will open.
  4. Type in the name of the locked file or other file of interest. Partial names are usually sufficient.
  5. Click the button “Search”,
  6. A list will be generated. There may be a number of entries.
  7. An individual handle in the list can be killed by selecting it and pressing the delete key. However, care is necessary when deleting handles, as instabilities may occur. Often, just rebooting will free a locked file.

Process Explorer can be downloaded here.

A related article is Best Free Undeletable File Remover

Get your own favorite tip published! Know a neat tech tip or trick? Then why not have it published here and receive full credit? Click here to tell us your tip.


This tips section is maintained by Vic Laurie. Vic runs several websites with Windows how-to's, guides, and tutorials, including a site for learning about Windows and the Internet and another with Windows 7 tips.

Click here for more items like this. Better still, get Tech Tips delivered via your RSS feeder or alternatively, have the RSS feed sent as email direct to your in-box.

Share this
3.701755
Average: 3.7 (57 votes)
Your rating: None

Comments

by mrinmoyjk on 21. July 2013 - 7:52  (109448)

I use Unlocker for the same thing. It can also delete files/folders which can't be deleted normally.

http://www.emptyloop.com/unlocker/
Download link is in the middle of the page.

by Anupam on 21. July 2013 - 8:15  (109449)

The editor has already mentioned the link for the review of Best Free Undeletable File Remover, which contains Unlocker.

by Phylis Sophical on 20. July 2013 - 15:54  (109425)

How to you access Process Explorer? Doesn't come up in my Windows Search or Ctrl Panel. (using Win7 Pro)

by v.laurie on 20. July 2013 - 16:42  (109427)

The download link is in the article about Process Explorer that is referred to in the beginning of the tip. However, for convenience, I have now added a link to the Microsoft download page.

by Anupam on 20. July 2013 - 16:02  (109426)

Process Explorer is a separate program from Microsoft. You can download it from here:

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

Gizmo's Freeware is Recruiting!

Gizmos Needs YouShare your knowledge of free software with millions of Gizmo's readers by joining our editing team.  Details here.