1. Open files - Windows
- Posted by Mike777b Dec 23, 2018
- 1695 views
Is anybody aware of a routine or process that allows for the enumeration of open files by process? I have been having problems with a particular computer that, all of a sudden, seems to be fond of spontaneously re-booting. I know the long term solution is to replace the computer, but it is just long enough between re-boots that I can limp along for now. The only irritation is that it takes me too long to restore the computer to the exact state it was in just before a re-boot. I already have an Excel macro set up which enumerates open excel and word files, so restoring those is a relatively simple process. However, invoking the macro is a bit more tedious than I'd like so I was hoping for a 4.0.5 1-click solution that would not only interrogate Office files but could also encompass other programs that don't auto-load after a re-boot (such as Open Office Write).
Thanks
mike
2. Re: Open files - Windows
- Posted by ChrisB (moderator) Dec 23, 2018
- 1640 views
Hi Not specifically, but google 'lsof for windows' as a starting point (list open files on Linux)
Cheers
Chris
3. Re: Open files - Windows
- Posted by Mike777b Dec 23, 2018
- 1657 views
The windows equivalent is "handle" from sysinternals.
Thanks
mike
4. Re: Open files - Windows
- Posted by Mike777b Jan 10, 2019
- 1609 views
handle is, to say the least, cumbersome to work with. It appears to maintain information for open files associated with excel and word processes just fine (.doc, .docx, .xls and .xlsx). But pointers to paths associated with Explorer windows include not only visible windows but whole bunches of paths not associated with visible windows. I'm guessing it includes recently visited paths as well as paths that are opened by other (not visible) processes.
Still looking for a way to interrogate a windows system so as to build a list of paths associated with open files or paths.
Thanks
mike
5. Re: Open files - Windows
- Posted by ChrisB (moderator) Jan 10, 2019
- 1532 views
Hi Mike,
just like lsof, this is a list of ALL files in use by the system, and is not exclusive to windows that are open and currently visible on the desktop.
This sounds like you want to do two things 1. - get a list of open windows 2. - get a list of open files associated with these windows
If thats the case, then Enhanced process list by JM Duro along with handle and a routine written by yourself to filter the output, may be what you are looking for.
also http://phix.x10.mx/pmwiki/pmwiki.php?n=Main.MonitorAllWindows
Of course, I might be completely wrong.
Cheers
Chris
6. Re: Open files - Windows
- Posted by Mike777b Jan 10, 2019
- 1536 views
Thanks, Chris.
Ran it (had to comment out detectCD routine in myFile.e because dos_interrupt not declared, but I'm not doing anything with CD information anyway).
Very nice listing, but I didn't see anything which identified the open files associated with the windows.
Process_List.exw has a timer which causes the list to refresh. It also has a log file which captures each process and some window information (PID, etc.) I let the program run for a while so as to build a log file with several megabytes. Searched logfile and didn't see any file names (such as "xxxxx.xls").
I'll keep looking through the code to see if there isn't a convenient place to expand the logic to isolate open file names, but I would appreciate input as to where to look.
Thanks
mike
7. Re: Open files - Windows
- Posted by ChrisB (moderator) Jan 12, 2019
- 1484 views
Hi
I am still thinking about this, there may bo more than one way to skin this particular cat. What, defined exactly, are trying to achieve.
Chris
8. Re: Open files - Windows
- Posted by Mike777b Jan 14, 2019
- 1385 views
I am trying to restore my desktop, as close as possible, with as little effort as possible when an unexpected shutdown takes place.
I might have 11 spreadsheets open, with 15 word files (some of which are .doc, some .docx, some .rtf) and 6 or so explorer windows focused on a particular folder.
Going through the autorecover process can take an hour, and is of limited utility anyway since I have the habit of saving any file I modify every five minutes.
Browsers have this built in, so if I have 50 tabs open in Opera, when I reload Opera after an unexpected shutdown those 50 tabs dutifully re-appear.
Let me know if that isn't clear.
Thanks
mike
9. Re: Open files - Windows
- Posted by ChrisB (moderator) Jan 14, 2019
- 1367 views
Hi
No, that's perfectly clear. I'm sure everyone else reading this will also be churning potential solutions too. Do you have a lot of unexpected shutdowns - if its power, get a UPS.
Cheers
Chris
10. Re: Open files - Windows
- Posted by ChrisB (moderator) Jan 14, 2019
- 1360 views
And another thought - windows can keep a list of recently opened documents, maybe some way to tap into that.
Cheers
Chris
11. Re: Open files - Windows
- Posted by Mike777b Jan 14, 2019
- 1337 views
I am responsible for enough machines (wife, etc.) that it happens just often enough to justify this journey. Yes, a battery back up is in place on the desktops. By far the most common issue surrounds laptops that are hibernated (or slept) and then refuse to unhibernate (awaken properly), forcing a cold boot.
I suspect the various recently used files indicators can be interrogated out of the registry, but I'm clueless how to do that and would need at least a little (or not so little) push in the right direction.
Thanks for the replies.
mike
12. Re: Open files - Windows
- Posted by irv Jan 14, 2019
- 1372 views
I found something that might give you a place to start:
http://www.nirsoft.net/utils/opened_files_view.html
It seems that this can output data to the terminal, which you could capture and feed into a eu program to re-open those files.
13. Re: Open files - Windows
- Posted by Mike777b Jan 14, 2019
- 1369 views
Thanks, Irv! I do believe it gives me what I need to pull this off. I already had a different utility from that same website but I guess I just glossed over this one.
mike