Sign in to follow this  
Followers 0
Intosia

Open file handles of a program?

3 posts in this topic

#1 ·  Posted (edited)

Hi,

Is it possible to a get a list of the open file handles that a given application has?

Tia

Edited by Intosia

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

Is it possible to a get a list of the open file handles that a given application has?

Tia

Not AutoIt related, maybe OT but...

Windows Server 2003 Resource Kit Tools: rktools.exe

http://www.microsoft.com/downloads/details...;displaylang=en

Open Handles utility: oh.exe

capture output with Run $STDOUT_CHILD

OpenedFilesView v1.05

http://www.nirsoft.net/utils/opened_files_view.html

Sysinternals Utilities: Process

Process Explorer - find and close handles

http://www.microsoft.com/technet/sysintern...sutilities.mspx

Edited by rover

I see fascists...

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Intosia,

If you are going to go off the reservation use SysInternals Handle (Displays which files are open by which processes):

http://technet.microsoft.com/en-us/sysinternals/bb896655

Embed Handle.exe into your AutoIt app.

Since it is a console tool you can redirect the output for consumption by AutoIt.

Microsoft Word Viewer 97 example:

- - - - Command Window - cmd.exe - - - - Microsoft Word Viewer  - - - -
- - - - two data files: {1D4: File  (R--)   C:DataNotesPE BuilderPE Builder.doc}  - &  - {58: File  (R--)   E:DataWEBMedicalDietBelated Happy Birthday Mark.doc}

C:Program FilesMyUtilitiesMyPortableAppsPortableAppsNirLauncherNirSoft>handle -p wordview
Handle v3.42
Copyright (C) 1997-2008 Mark Russinovich
Sysinternals - www.sysinternals.com
------------------------------------------------------------------------------
WORDVIEW.EXE pid: 2656 CP01XPCP01
    C: File  (RW-)   C:DataNotesPE Builder
   4C: File  (RW-)   C:WINDOWSWinSxSx86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202
   58: File  (R--)   E:DataWEBMedicalDietBelated Happy Birthday Mark.doc
   64: Section     BaseNamedObjectsRotHintTable
   6C: Section     BaseNamedObjectsMso97SharedDg1921
   78: Section     BaseNamedObjectsCiceroSharedMemDefaultS-1-5-21-2974678393-782023779-1867764154-1005
   A0: Section     BaseNamedObjectsCTF.TimListCache.FMPDefaultS-1-5-21-2974678393-782023779-1867764154-1005SFM.DefaultS-1-5-21-2
974678393-782023779-1867764154-1005
   A4: File  (RW-)   C:WINDOWSWinSxSx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_31a54e43
   E0: Section     BaseNamedObjectsShimSharedMemory
   E8: Section     BaseNamedObjectsMso97SharedDg2032
  1CC: Section     BaseNamedObjectsDFMap0-26126577
  1D0: Section     BaseNamedObjectsDfSharedHeap18EA8E8
  1D4: File  (R--)   C:DataNotesPE BuilderPE Builder.doc
  1DC: Section     BaseNamedObjectsDfRoot0018EA8E8
  1E0: File  (RWD)   C:DOCUME~1CP01LOCALS~1Temp~DFA8FC.tmp
  1E4: Section     BaseNamedObjectsDFMap0-26126629
  224: Section     BaseNamedObjectsMSCTF.GCompartListSFM.DefaultS-1-5-21-2974678393-782023779-1867764154-1005
  234: Section     BaseNamedObjectsMSCTF.Shared.SFM.EPCB
  250: File  (RW-)   C:WINDOWSWinSxSx86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202
  25C: Section     BaseNamedObjectsMSCTF.Shared.SFM.EON
  274: File  (RW-)   C:WINDOWSWinSxSx86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202
  278: Section     BaseNamedObjectsDFMap0-26705627
  284: Section     BaseNamedObjectsDfSharedHeap1977ED1
  288: Section     BaseNamedObjectsDfRoot001977ED1
  28C: File  (RWD)   C:DOCUME~1CP01LOCALS~1Temp~DF7EE0.tmp
  290: Section     BaseNamedObjectsDFMap0-26705643

The only gotcha is that some programs work in memory and so their data files are not held open -- Notepad, SciTE, Wordpad etc.

SciTE example:

- - - - Command Window - cmd.exe - - - - SciTE uses in memory pointers - - - -

C:Program FilesMyUtilitiesMyPortableAppsPortableAppsNirLauncherNirSoft>handle -p scite

Handle v3.42
Copyright (C) 1997-2008 Mark Russinovich
Sysinternals - www.sysinternals.com

------------------------------------------------------------------------------
SciTE.exe pid: 5268 CP01XPCP01
    C: File  (RW-)   C:DataAutoIt_Mybeta
   10: File  (RW-)   C:WINDOWSWinSxSx86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202
   40: File  (RW-)   C:WINDOWSWinSxSx86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202
   54: Section     BaseNamedObjectsCiceroSharedMemDefaultS-1-5-21-2974678393-782023779-1867764154-1005
   74: Section     BaseNamedObjectsCTF.TimListCache.FMPDefaultS-1-5-21-2974678393-782023779-1867764154-1005SFM.DefaultS-1-5-21-2
974678393-782023779-1867764154-1005
   78: File  (RW-)   C:WINDOWSWinSxSx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_31a54e43
   B4: Section     BaseNamedObjectsShimSharedMemory
   BC: Section     BaseNamedObjectsMSCTF.GCompartListSFM.DefaultS-1-5-21-2974678393-782023779-1867764154-1005
   CC: Section     BaseNamedObjectsMSCTF.Shared.SFM.EPCB
   DC: Section     BaseNamedObjectsMSCTF.Shared.SFM.MOL[/font][/color][/font][/color]

Ouch!

Edited by Schuss

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0