Ever wondered which program has a particular file or directory open? Now you can find out. Handle is a utility that displays information about open handles for any process in the system. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program.
You can also get a GUI-based version of this program, Process Explorer, here at Sysinternals.
You run Handle by typing "handle". You must have administrative privilege to run Handle.
Handle works on Windows 9x/Me and Windows NT and higher as well as x64 Windows XP and Windows Server 2003 64-bit Editions.
Handle is targetted at searching for open file references, so if you do not specify any command-line parameters it will list the values of all the handles in the system that refer to open files and the names of the files. It also takes several parameters that modify this behavior.
usage: handle [[-a] [-u] | [-c <handle> [-y]] | [-s]] [-p <processname>|<pid>> [name]
When not in search mode (enabled by specifying a name fragment as a parameter), Handle divides its output into sections for each process it is printing handle information for. Dashed lines are used as a separator, immediately below which you will see the process name and its process id (PID). Beneath the process name are listed handle values (in hexadecimal), the type of object the handle is associated with, and the name of the object if it has one.
When in search mode, Handle prints the process names and id's are listed on the left side and the names of the objects that had a match are on the right.
Here are some other monitoring tools available at Sysinternals:
The following Microsoft KB articles reference Handle for diagnosing or troubleshooting various problems: