How can I tell what process has a file opened on Windows?

Question ID : 135
Created on 2010-07-13 at 11:29 PM
Author : Veryant Support [support@veryant.com]

Online URL : http://support.veryant.com/support/phpkb/question.php?ID=135



Use Windows Sysinternals Handle utility.

For example, download http://download.sysinternals.com/Files/Handle.zip and extract handle.exe to a directory in your PATH such as C:Windows. Or copy it to a new directory named C:Sysinternals and add that to your PATH.

Here are some examples:

handle -help
will show the usage information.

handle name_fragment
will show all handles in the system that refer to open files whose names include name_fragment

handle -a name_fragment
will show all types of handles in the system that refer to resources whose names include name_fragment. Use -a if you want to see resources on network attached storage (NAS) or a storage area network (SAN). For example, if drive M: is mapped to a network share named \MyServerpublic, use the following command to see what processes and users have opened the file W:mydirmyfile:

handle -a -u MyServerpublicmydirmyfile

or simply:

handle -a -u myfile

For more information about Windows Sysinternals visit http://technet.microsoft.com/en-us/sysinternals/default.aspx


Back to Original Question