Is it possible to programatically find out what process is locking a file across a network

我与影子孤独终老i 提交于 2020-01-03 15:22:08

问题


I have a file on a Windows 2003 server which is locked by a process running on another Windows 2003 server. Is it possible to find out which process on which machine is locking this resource. I don't mind which language I use to do this.


回答1:


http://technet.microsoft.com/en-us/sysinternals/bb897552.aspx

PsFile

The "net file" command shows you a list of the files that other computers have opened on the system upon which you execute the command, however it truncates long path names and doesn't let you see that information for remote systems. PsFile is a command-line utility that shows a list of files on a system that are opened remotely, and it also allows you to close opened files either by name or by a file identifier.

...

How it Works

PsFile uses the NET API, which is documented in the Platform SDK.



来源:https://stackoverflow.com/questions/208283/is-it-possible-to-programatically-find-out-what-process-is-locking-a-file-across

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!