|
-
December 23rd, 2007, 03:06 AM
#1
How to detect name of application that has locked File/Folder?
Hello to all!
Season's Greetings!
Sorry guys to disturb you in your Holiday mood! Facing a problem in my application and not able to find solution to solve it. I'm working on a project in which I need to delete a few files/folders at the time of Application Unload. Many a times it happens that the files/folders which I'm willing to delete are already "in use" by some other application. So, I would like to Log this situation to application log file.
I've written a code to detect if File is in Use by other application or not. But can we find the name of application executable file that has locked it? I searched on Google for the same; but couldn't find a solution to get this done in Visual Basic 6.0 (or any other programming language for that matter). Instead, I came to know about a tool called "Unlocker" which does the same. So, certainly what I'm looking for is possible to implement in program; just the thing that I don't have even a slightest clue of how it can be achieved.
Can you please help me in this issue? How can we achieve this in Visual Basic 6.0? I found some Processes related code on PSC (some of them are quite adanced and listed all Threads/Sub-threads etc). But I couldn't conclude from that information on the application that has locked a certain file or folder.
Please help me to understand the process behind this. Thanks for taking time and reading/thinking over my query.
Eagerly waiting for your reply ...
Regards,
Ruturaaj.
----
*P.S.: If you need to investigate the above mentioned Unlocker application & want me to give you download link then just let me know & I will post it here; no problem. I don't know if Forum rules will allow me to post a link for third party tool here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|