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

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

Authored by: Veryant Support on Tue, Jul 13th, 2010 at 7:00 PM
This question has been viewed 18850 times so far.
Online URL: http://support.veryant.com/support/phpkb/question.php?ID=135

Powered by PHPKB Knowledge Base Software