Desson Ariawan Programmer. Tutorials Windows. The action can't be completed because the folder or a file in it is open in another program. To get the process holding those folder or file, we can use these two utilities: Resource Monitor Process Explorer. For Windows 7 and above, you can use the built-in Resource Monitor. Open Resource Monitor, which can be found By searching for resmon. Open Process Explorer running as "administrator" by running procexp. Type in the name of the locked file or other file of interest in the Search dialog box, then click "Search".
Handle is a utility that displays information about open handles for any process in the system. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program. You run Handle by typing "handle".
You must have administrative privilege to run Handle. Handle is targeted at searching for open file references, so if you do not specify any command-line parameters it will list the values of all the handles in the system that refer to open files and the names of the files. It also takes several parameters that modify this behavior.
When not in search mode enabled by specifying a name fragment as a parameter , Handle divides its output into sections for each process it is printing handle information for.
Dashed lines are used as a separator, immediately below which you will see the process name and its process id PID. Beneath the process name are listed handle values in hexadecimal , the type of object the handle is associated with, and the name of the object if it has one.
When in search mode, Handle prints the process names and id's are listed on the left side and the names of the objects that had a match are on the right. Asked 12 years, 8 months ago. Active 4 months ago. Viewed k times. Any suggestions on how to find the culprit? Improve this question. Alan Fleming 73 8 8 bronze badges. You would think that after all this time, the Windows guys would give us a way to do this easily from within Explorer. I wonder why this hasn't happened? I find that Explorer is very often the problem process that is holding onto a file for no obvious reason.
I know this doesn't help you much, but I think I remembered that this was a planned feature of the next Windows release after vista and server. Issue still exists in Windows Randomly got to this question on unrelated search. When I stumble upon this problem with something holding the file, it's often explorer.
Now you need to restart your explorer. Show 1 more comment. Active Oldest Votes. Improve this answer. Eddie Eddie You can close the handle, but keep in mind, you're pulling the rug out from under an application, results will be unpredictable at best.
Walden: Absolutely. When this happens on a file you need to delete, you have the choice of forcing the handle closed, or rebooting. So far, having done this dozens of times, I have suffered no ill effect.
As with any advanced tool, use with caution and judgment. Closing the handles can cause the app to re-use the handle on another file, causing corruption - see Jeff's answer below: serverfault. For explorer, btw, hold ctrl-shift and right-click a blank area of the start menu, and you'll get "Exit Explorer" - ps, not quite Jeff's answer..
It should be noted that ProcessExplorer must be run as Administrator or it may not able to see files open by system processes. Show 12 more comments. Svish Svish 6, 14 14 gold badges 34 34 silver badges 45 45 bronze badges.
It's worth noting that it can be hard to find this program on Windows 8 - a search for 'resmon. Kylotan, Stop wasting time searching. Just run resmon directly from cmd — Pacerier. Pacerier: Nice. I'm not used to things being in the Windows path. Show 9 more comments. Community Bot 1. Mark Sowul Mark Sowul 1, 1 1 gold badge 10 10 silver badges 14 14 bronze badges. It seems strange to me that Windows would immediately re-use the number of a closed handle, rather than continuing to increment the number and only wrapping around when necessary.
That would at least greatly reduce the chances of this problem happening. RichVel Terminating the culprit process is probably better than a complete reboot. DmitryGrigoryev - good point, and in fact I already mentioned that here — RichVel. This is a very important warning, but doesn't answer the question How do you find what process is holding a file open in Windows? Show 4 more comments.
John Fouhy John Fouhy 1, 7 7 silver badges 4 4 bronze badges. Really helpful. This makes this feature not very useful. Show 2 more comments. Greg Hewgill Greg Hewgill 6, 3 3 gold badges 28 28 silver badges 26 26 bronze badges. I use this tool all the time.
Best of all, you can use it to force close handles. I've been told so many times at SO that link-only answers are discouraged. With this here now I'm one of those purists. Add a comment.
0コメント