Which process holding file




















I found that it had to be run with elevated privileges in a lot of circumstances otherwise it fails when trying to get the list of processes locking a file. Show 15 more comments. It is very complex to invoke Win32 from C. Start ; tool. GetProcessById int. Parse match. Uwe Keim Gennady Zabrodsky Gennady Zabrodsky. I've updated Gennady's answer with the change. You can't redistribute handle.

I disagree - it has no complexity when invoking win32 api from c. This is really slow for me. Did anyone find a faster way of doing this?

Especially for multiple files? Show 5 more comments. We do this in our deployment script - works like a charm. Good point. This wasn't a problem with the deployment script used internally , but would be in other scenarios. Check out my answer for a solution that does not require handle. Collections; using System. Diagnostics; using System. Management; using System.

Print p. CompareTo strFile. See What does this do? I so very much fail to see why myProcessArray is a class member but also actually returned from getFileProcesses? Same goes for myProcess. C : using System. Item j. Net: Imports System. Management Imports System. Count - 1 If modules.

Stefan Stefan Active 5 years, 5 months ago. Viewed 51k times. Can anyone drop me a hint? Improve this question. Add a comment. Active Oldest Votes. Improve this answer.

Community Bot 1 1 1 silver badge. Neil Neil MichaelBest Search the link in the Wayback Machine to get a nicely formatted result, or to see the migrated version here. Marc Marc 1, 2 2 gold badges 10 10 silver badges 15 15 bronze badges. On Linux this is not much of a problem since inodes are refcounted, so you can remove a file even if someone is holding it open. AndreasN AndreasN 2, 2 2 gold badges 23 23 silver badges 29 29 bronze badges. Mathias Mathias Sign up or log in Sign up using Google.

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. LockHunter can unlock any handlers that may have locked your files or folders. Unlike similar freewares, it supports both 32 and 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. 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. Starting from version 1. 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. If you do not know the program the file it is using then you can go to My Computer; right click; select Manage. You can close file from here and then you can perform the task of rename or delete the file.

Hope this helps. In older versions of Windows, you might get "Access Denied - you might not have rights, or the file might be in use". If you find through Process Explorer that the files are, in fact, not opened by anyone, odds are that there is an issue with security. Using an administrator account, select the files in Explorer, right-click and select Properties, Security, Advanced, Owner. Odds are that the files are owned by an account that no longer exists or can no longer be verified to exist because of changing Active Directory trust settings.

Apparently, this backup process leaves enough of a "ghost like file. However, I kept getting the error message:. Close any programs that might be using this file and try again. I have created a small utility ShowWhatProcessLocksFile which shows what processes lock a selected file or folder f. It integrates into the File Explorer's context menu to allow selecting a file or folder.

Note: the application requires admin permissions. If for some reasons you don't like my program, I recommend you to try Lock Hunter. I was having trouble finding out the process that locked my epmd.

So, I thought of giving it a try and it worked so, this can be another option :. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Learn more. Find out which process is locking a file or folder in Windows Ask Question. Asked 11 years, 8 months ago. Active 1 month ago.

Viewed 1. 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?

Improve this question. See this ServerFault question. Is your file a video?



0コメント

  • 1000 / 1000