One of my favourite tools for linux is lsof - a real swiss army knife!
Today I found myself wondering which programs on a WinXP system had a specific file open. Is there any equivalent utility to lsof? Additionally, the file in question was over a network share so I'm not sure if that complicates matters.
Use Process Explorer from the Sysinternals Suite, the Find Handle or DLL function will let you search for the process with that file open.
If the file is a .dll then you can use the TaskList command line app to see whose got it open:
The equivalent of
lsof -p pid
is the combined output from sysinternals handle and listdlls, ieyou can find out pid with sysinternals
pslist
.There is a program "OpenFiles", seems to be part of windows 7. Seems that it can do what you want. It can list files opened by remote users (through file share) and, after calling "openfiles /Local on" and a system restart, it should be able to show files opened locally. The latter is said to have performance penalties.