How to find out what processes have folder or file locked?

∥☆過路亽.° 提交于 2019-12-20 21:47:13

问题


How do you go about querying running processes to find out what folders or files they have locked? (i.e. you go to eject a drive and you're told that it can't be ejected because it's in use)

I'd like to either get an "off the shelf" download, or write a .NET 3.5 app to do this (primarily a Windows question).


回答1:


Process Explorer will show you this. Ctrl-F will let you search for a file and list the process(es) that have that file open/locked. You can then close that handle using Process Explorer.

There's also a command line utility called oh.exe available for download. See here for more details




回答2:


LockHunter is a great context menu tool for Windows.




回答3:


One of the first things I put on my Windows dev machines is WhoUses. It's nice because it's open source too.




回答4:


http://www.emptyloop.com/unlocker/ (freeware) has a special UI for exactly this situation.



来源:https://stackoverflow.com/questions/1084482/how-to-find-out-what-processes-have-folder-or-file-locked

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