Re: Checking if a file is opened
- From: mr_unreliable <kindlyReplyToNewsgroup@xxxxxxxxxxx>
- Date: Thu, 29 Dec 2005 14:56:07 -0500
hi again Frank,
I may have a more appropriate sysinternals utility for you.
Take a look at the "Process Explorer v9.25" found here:
http://www.sysinternals.com/ProcessesAndThreadsUtilities.html
--- <quote> --- Find out what _FILES_ (emphasis mine), registry keys and other objects processes have open... --- </quote> ---
I am not quite up to date with the latest version, but the v8.xx version has an upper pane showing the processes, and a multi- purpose "lower pane". If you configure the lower pane to show "system handles", and click on a particular process, then you get a listing of system resource "handles" in the lower pane.
If you peruse through the handle listing, you will see lots of "techy" stuff, (like mutexes and semaphores), but also the handles of open files. In other words it gives you a listing of files associated with each process (i.e., each app).
Frankly, I have looked at a lot of vb source code, and not seen
anything that would produce a listing of system resource handles
like the sysinternals process explorer produces. I strongly suspect that Mark Russinovich and Bryce Cogswell have a deep-throat-
Microsoftie" who is giving them information about windows internal tables, or else Mark & Bryce have spent weeks, months, even YEARS combing through hex dumps "reverse engineering" the system internal tables to get that listing of handles.
The point is, I don't think you are going to easily find anything like what Mark and Bryce have coded up. Certainly not in any scripting language or 3rd-party objects, and probably not even in any vb code.
cheers, jw
FrankWinkler wrote:
Hi jw!
Thanks for your reply. I think you're right. It seems to be not so easy to find out directly which file is opened by which application using a pure script.
I think the easiest solution would be to use a script that returns a list that is similar to the list showed on the first tab of Windows Task Manager. In this list not only the running applications are shown, the opened files are displayed, too. By calling such a script maybe every 2 seconds and looking in the returned list for the interesting file(s), it should be possible to find out if a file is opened or closed. The delay (maybe 2 seconds) should'nt be that problem.
Of course I looked for a a solution like that. Unfortunatelly I found only lots of scripts for getting the running processes (like second tab in Task Manager) using Win32_process. Maybe someone here knows a solution (script) that returns that applictaion list?
Frank
.
- Follow-Ups:
- Re: Checking if a file is opened
- From: FrankWinkler
- Re: Checking if a file is opened
- References:
- Checking if a file is opened
- From: FrankWinkler
- Re: Checking if a file is opened
- From: mr_unreliable
- Re: Checking if a file is opened
- From: FrankWinkler
- Checking if a file is opened
- Prev by Date: Re: Trying to get the username of the person logged in on a remote mac
- Next by Date: ActiveDesktop and GetObject
- Previous by thread: Re: Checking if a file is opened
- Next by thread: Re: Checking if a file is opened
- Index(es):
Relevant Pages
|