How can I determine whether a specific file is ope

2019-01-04 00:04发布

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.

10条回答
时光不老,我们不散
2楼-- · 2019-01-04 00:30

Use Process Explorer from the Sysinternals Suite, the Find Handle or DLL function will let you search for the process with that file open.

查看更多
聊天终结者
3楼-- · 2019-01-04 00:31

If the file is a .dll then you can use the TaskList command line app to see whose got it open:

TaskList /M nameof.dll
查看更多
Viruses.
4楼-- · 2019-01-04 00:32

The equivalent of lsof -p pid is the combined output from sysinternals handle and listdlls, ie

handle -p pid
listdlls -p pid

you can find out pid with sysinternals pslist.

查看更多
小情绪 Triste *
5楼-- · 2019-01-04 00:32

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.

查看更多
登录 后发表回答