用于查看哪个程序正在使用文件的 Windows 程序

软件推荐 视窗 文件管理 任务管理
2021-10-28 19:01:09

通常,在我的 Windows 计算机上,当我删除或移动目录或文件时,会出现一条错误消息,说明此操作无法完成,因为其中一个文件正在被另一个程序使用。

对于给定的文件,是否有一个程序可以让我找出正在使用它的程序并结束该程序?

4个回答

I regularly use Process Explorer, (free from Microsoft), to do exactly what you are asking for you can search for which programs/tasks are using a given file or directory and then kill the program or program tree. You can even find a DLL that has a given file locked and then find and kill those programs that are using that DLL.

Process Explorer Main Window

It also gives you a lot of other useful information. System Information

Try Unlocker.

It creates an entry in the right-click menu of files which will show you a list of processes that are accessing the file, through which you can then detach the process (or if needed kill it outright).

I use Unlocker regularly to help me safely eject USB drives that like to have handles kept open and more often than not it does help. The only downside I have found (and this may not be a problem with Unlocker itself, but with the programs that are keeping the handles open) is that most times simply detaching the process doesn't work and I have to kill it outright.

While there are a number of more feature-full programs that can perform the same functionality as Unlocker, for the purpose of releasing file handles this is the one I have found to be quicker and to work more consistently.

Note: Please be aware Unlocker contains potentially malicious adware in the installation process and employs the OpenCandy advertising module in its installer. If you are cautious during the installation process, read every dialog presented to you, and deselect anything that doesn't sound like it is part of Unlocker then you can easily avoid installing anything malicious on your system.

The following image shows the dialog that I received as a result of the OpenCandy module, where I have already selected "Advanced" and unchecked the "Install Delta toolbar" checkbox:

Delta Toolbar installer

LockHunter is another great free tool.

download link

With a bit of finessing, process monitor by sysinternals would do this. The only real issue is the sheer amount of information - you're expected to use the filters, but I ended up simply restricting the information shown to file system activity, and see what program is using it by searching for the exact filename (In this case, test.text).

与任何 sysinternals 软件一样,它小巧、便携并且完全按照它在锡上所说的那样做——它实际上除了通过文件系统、注册表、网络和进程活动监控进程之外没有其他功能。考虑到它需要的访问级别,它需要以管理员身份运行/接受 UAC 升级。

它不会让你直接解锁文件,但它会告诉你 wnat 正在使用它,并且你可以正确地终止父进程以撤消锁定。

在此处输入图像描述