6.11. Viewing the Handles a Process Has Open
You want to view all the handles a process has open. This is handy if you want to find out all of the files and registry keys a particular process is using.
Using a graphical user interface
Open the Sysinternals Process Explorer tool (procexp.exe).
From the menu, select View → View Handles.
Click on the process you want to view. In the bottom window, the list of handles being used by that process will be displayed.
Using a command-line interface
To view all of the handles a process has open, use the following command:
> handle -a -p
You can also search for a specific handle using the following command:
For example, if you want to find all processes that have the
c:\test directory open, you
There are no scripting interfaces to get this information. To get it programmatically, you must use the Win32 API or .NET Framework, or shell out to the handle utility.
Have you ever wanted to see all of the resources a particular process is using? Perhaps you have a new application or service and you want to see what files it touches, what registry keys it has open, what Windows stations it uses, etc. The lovely Process Explorer (and handle.exe command-line equivalent) can give you this and much more. The cool thing about Process Explorer is that it even lets you close a particular handle if you want to; from the bottom window simply right-click ...