- How To Know Which Process is Using a File or Folder in Windows
- Resource Monitor
- Process Explorer
- My Take
- How to Identify which Windows Process is Locking a File or Folder
- Symptoms
- How to Solve the Issue
- Identify what program is using a file
- Identify which handle or DLL is using a file
- Release the lock on the file or folder
- Windows which process is using file
- Question
- All replies
- Gizmo’s Freeware
- Login / Register
- Main menu
- How to Find Out Which Windows Process is Using a File
- How to find out what program is using a file
- How to find out which handle or DLL is using a file
- Find out which process is locking a file or folder in Windows
- 11 Answers 11
How To Know Which Process is Using a File or Folder in Windows
Ever wondered which program has a particular file or directory open? Quite often, when trying to delete a folder, Windows reports this:
This error also happens with a file, when we tried to move a file, or delete those file. How we can find out which program or application is currently using it and preventing us to delete/move it? To get the process holding those folder or file, we can use these two utilities:
Resource Monitor
For Windows 7 and above, you can use the built-in Resource Monitor.
Open Resource Monitor, which can be found
- By searching for resmon.exe in the start menu, or
- As a button on the Performance tab in your Task Manager
Resource Monitor from Task Manager’s Performance Tab
From CPU tab, use the search field in the Associated Handles section
When you’ve found the handle, you can identify the process by looking at the Image and/or PID column. You can then close the application if you are able to do that, or just right-click the row and you’ll get the option of killing the process (End Process) right there.
Process Explorer
Process Explorer shows you information about which handles and DLLs processes have opened or loaded.
- Open Process Explorer (running as «administrator») by running procexp.exe or procexp64.exe.
- Enter the keyboard shortcut Ctrl+F. Alternatively, click the “Find” menu and select “Find a Handle or DLL”.
Process Explorer — Find Handle or DLL
- Type in the name of the locked file or other file of interest in the Search dialog box, then click «Search». Partial names are usually sufficient.
- A list will be generated. There may be a number of entries. Click one of the entry, it’ll «Refreshing handles».
Process Explorer — Search
Same as Resource Monitor, an individual handle in the list can be killed by selecting it and pressing the delete key (or Close Handle). However, please be careful when deleting handles, as system instabilities may occur. Rebooting your system maybe will free the locked file/folder.
Process Explorer — Close Handle
Handle is a command line version of Process Explorer.
My Take
I prefer to use Resource Monitor compare to Process Explorer since Process Explorer is slower (especially during «Refreshing handles» process). If I can’t find the handle in Resource Monitor, then I use Process Explorer.
Liked this Tutorial? Share it on Social media!
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.
Symptoms
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:
- Open Process Explorer
- Running as administrator.
- On the toolbar, find the gunsight icon on the right.
- Drag the icon and drop it on the open file or folder that is locked.
- 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
- Open Process Explorer
- Running as administrator.
- Enter the keyboard shortcut Ctrl+F.
- Alternatively, click the “Find” menu and select “Find a Handle or DLL”.
- A search dialog box will open.
- Type in the name of the locked file or other file of interest.
- Partial names are usually sufficient.
- Click the button “Search”.
- 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:
- Selecting the process/handle/program entry.
- Pressing the delete key.
Proceed with care when deleting handles as this may generate erratic behavior and instabilities may occur.
Windows which process is using file
Question
Hi All,
Can you please let me know how to find which applications are using the Page File and how much PF is allocated to each application?
All replies
There’s no easy way to tell how much of a process has actually been paged out to the pagefile (i.e. actually stored in the pagefile thus using it). I am not aware of a tool that reports this information per process.
What is easily available are two PerfMon counters per process called: «Page File Bytes» and «Page File Bytes Peak». The former is also available as «Commit Size» column in task manager. These values represent the amount of memory the process has committed, which is charged against a global commit limit. The commit limit is physical memory size + pagefile size. So as the process commits memory, commit space is reserved for that process out of the total commit limit, which can come from the pagefile or physical memory.
The committed number can be very misleading because a process can commit a lot of memory but not actually touch any of it, in which case he’s not consuming any physical memory or pagefile space. So we don’t recommend using this metric for performance analysis. They are usually useful to find processes that leak memory, or if the system actually starts to run out of commit (in which case one can simply increase the pagefile size, but not necessarily hurt perf since those pages may never be accessed) to see who’s consuming it.
As far as performance analysis goes, amount of paging taking place per process is the interesting metric to look at, since disk then becomes the bottleneck and one would want to reduce that bottleneck. You can see what processes are accessing the page file by opening the Hard Faults summary table in xperf. That would be a pretty decent approximation as to which processes are paging the most.
Gizmo’s Freeware
Login / Register
Main menu
How to Find Out Which Windows Process is Using a File
Last updated by v.laurie on 03. February 2021 — 14:53
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:
- Open Process Explorer, running as administrator.
- On the toolbar, find the gunsight icon on the right (shown highlighted in the figure shown below).
- Drag the icon and drop it on the open file or folder that is locked.
- 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
- Open Process Explorer, running as administrator.
- Enter the keyboard shortcut Ctrl+F. Altenatively, click the “Find” menu and select “Find a Handle or DLL”.
- A search dialog box will open.
- Type in the name of the locked file or other file of interest. Partial names are usually sufficient.
- Click the button “Search”,
- A list will be generated. There may be a number of entries.
- 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.
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.
Find out which process is locking a file or folder in Windows
How can I find out which process is locking a file or folder in Windows?
For instance, when trying to delete a folder, Windows reports this:
The action can’t be completed because the folder is open in another program
Happens the same with a file, but how do I find out what program or application is currently using it and preventing me from deleting the file or folder?
11 Answers 11
The openfiles command needs to have support for local files enabled, by running openfiles /local on and restarting.
You can use the Resource Monitor for this which comes built-in with Windows 7, 8, and 10.
- Open Resource Monitor, which can be found
- By searching for Resource Monitor or resmon.exe in the start menu, or
- As a button on the Performance tab in your Task Manager
- Go to the CPU tab
- Use the search field in the Associated Handles section
- See blue arrow in screen shot below
When you’ve found the handle, you can identify the process by looking at the Image and/or PID column.
You can then try to close the application as you normally would, or, if that’s not possible, just right-click the handle and kill the process directly from there. Easy peasy!
A couple of options:
Microsoft/SysInternals Process Explorer — Go to Find > Find Handle or DLL. In the «Handle or DLL substring:» text box, type the path to the file (e.g. «C:\path\to\file.txt») and click «Search». All processes which have an open handle to that file should be listed.
WhoLockMe — Explorer extension which adds a right-click menu option
N.B. WhoLockMe appears to not work with Win 10 (at least I have been unable to register it with either of the 32- or 64-bit versions of regsvr32.exe).
Have a look at Process Explorer ( procexp.exe ).
From its introduction:
Ever wondered which program has a particular file or directory open? Now you can find out.
To find out what process is using a specific file follow these steps:
Go to Find, Find Handle or DLL.. or simply press Ctrl + F .
Enter the name of the file and press Search.
Process Explorer will list all processes that have a handle to the file open. Click on an entry to focus the process in the main window.
Optionally, you can then even close the handle manually through the lower pane ( Ctrl + L ):
LockHunter can unlock any handlers that may have locked your files or folders. Unlike similar freewares, it supports both 32 and 64-bit Windows.
It is a free tool to delete files blocked by something you do not know. LockHunter is useful for fighting against malware, and other programs that are blocking files without a reason. Unlike other similar tools it deletes files into the recycle bin so you may restore them if deleted by mistake.
- Shows processes locking a file or folder
- Allows to unlock, delete, copy or rename a locked file
- Allows to kill locking process
- Allows to remove locking processes from hard drive
- Integrates in to Explorer menu
- It deletes files into the recycle bin, so you may restore them if deleted by mistake
- Supports both 32 and 64bit Windows
EMCO UnlockIT can identify the process that has locked the file as well as unlock the file so that you may delete/edit/move it. The program is completely free, though the newer version is a bit slower and more bloated than the original (which had a plain, unskinned GUI, but loaded pretty much instantaneously and without an annoying splash screen). Also, the original version used to pop up automatically whenever the error you mentioned is triggered, allowing you to instantly unlock the file and perform the operation you were attempting.
Still, UnlockIT is an incredibly useful program that provides a basic functionality that is critically missing from Windows. It’s among the standard toolkit of utilities that I install on all Windows computers I work on.
A lot of the programs here are outdated. I finally ended up using nirsoft’s OpenedFilesView which worked really well.
Though the best part is the explorer menu integration, which is easy to enable. As per website
Starting from version 1.10, you can launch OpenedFilesView directly from Windows Explorer, and view only the handles of the file or folder that you want to inspect. In order to enable this feature, check the ‘Enable Explorer Context Menu’ under the Options menu. After you enable this feature, you can right-click on any file or folder on Windows Explorer, and choose the ‘OpenedFilesView’ item from the menu. If you run the OpenedFilesView option for a folder, it’ll display all opened files inside that folder. If you run the OpenedFilesView option for a file, it’ll display all opened handles for that file.