www.gsx.com | log in | register

Last update: . Author: GSX Support (Yann) .

How to Identify which Windows Process is Locking a File or Folder

While attempting to delete, move, or rename a file or folder you get a Windows warning message; the Operating System refuses to complete the operation.

This article helps identifying the process that currently has a handle on the file or folder you are attempting a maintenance operation on.

Sysinternals Process Explorer | Windows


When trying to delete, move, or rename a file you get a Windows system warning message:

  • "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".

How to Solve the Issue

One of the easiest ways to handle locked files or folders is to use Microsoft Sysinternals Process Explorer

Identify what program is using a file

Using Process Explorer 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. process-explorer-toolbar.png
  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.

Identify which handle or DLL is using a file

  1. Open Process Explorer
    • Running as administrator.
  2. Enter the keyboard shortcut Ctrl+F.
    • Alternatively, 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.

Release the lock on the file or folder

To release the lock on the file you are attempting the maintenance operation on, you will need to kill the appropriate process. An individual program or handle in the list provided by Process Explorer can be killed by:

  1. Selecting the process/handle/program entry.
  2. Pressing the delete key.

Proceed with care when deleting handles as this may generate erratic behavior and instabilities may occur.


You can download Sysinternals Process Explorer here.

Was this article helpful?

319 out of 944 found this helpful

Not finding what you are looking for?

Have more questions? Submit a request