Finding the process(s) that have locked a file
-
Does anybody know of any way to find out which application/process has locked a file? As an example, you have a file called widgets.txt and when you try and delete it you get a message along the lines of "Cannot delete widgets.txt, there has been a sharing violation, the source or destination file may be in use". The problem is this message doesnt tell you what it actually holding a handle on the file. I am currently working under the assumption that there is something in the Win API that I can call to get this information, however I am currently at a loss to what it is.
-
Does anybody know of any way to find out which application/process has locked a file? As an example, you have a file called widgets.txt and when you try and delete it you get a message along the lines of "Cannot delete widgets.txt, there has been a sharing violation, the source or destination file may be in use". The problem is this message doesnt tell you what it actually holding a handle on the file. I am currently working under the assumption that there is something in the Win API that I can call to get this information, however I am currently at a loss to what it is.
check this article and try to use that http://www.codeproject.com/system/Task_Manager_Extension.asp[^]
Regards R.Arockiapathinathan