windows 用于找出谁在锁定文件的命令行工具
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/241178/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Command-line tool for finding out who is locking a file
提问by JesperE
I would like to know who is locking a file (win32). I know about WhoLockMe, but I would like a command-line toolwhich does more or less the same thing.
我想知道谁在锁定文件(win32)。我知道WhoLockMe,但我想要一个命令行工具,它或多或少地做同样的事情。
I also looked at this question, but it seems only applicable for files opened remotely.
我也看过这个问题,但它似乎只适用于远程打开的文件。
回答by fhe
Handleshould do the trick.
句柄应该可以解决问题。
Ever wondered which program has a particular file or directory open? Now you can find out. Handle is a utility that displays information about open handles for any process in the system. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program.
有没有想过哪个程序打开了特定的文件或目录?现在你可以知道了。Handle 是一个实用程序,它显示有关系统中任何进程的打开句柄的信息。您可以使用它来查看打开文件的程序,或者查看程序的所有句柄的对象类型和名称。
回答by webclimber
handle.exe http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
handle.exe http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
THis has helped me sooooo many times....
这已经帮助了我很多次......
回答by MacGyver
Download Handle.
下载手柄。
https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
If you want to find what program has a handle on a certain file, run this from the directory that Handle.exe is extracted to. Unless you've added Handle.exe to the PATH
environment variable. And the file path is C:\path\path\file.txt", run this:
如果要查找某个文件的句柄,请从 Handle.exe 解压缩到的目录中运行此程序。除非您已将 Handle.exe 添加到PATH
环境变量中。并且文件路径是 C:\path\path\file.txt",运行这个:
handle "C:\path\path\file.txt"
This will tell you what process(es) have the file (or folder) locked.
这将告诉您哪些进程锁定了文件(或文件夹)。
回答by Pawel Cioch
Handle didn't find that WhatsApp is holding lock on a file .tmp.node in temp folder. ProcessExplorer - Find works better Look at this answer https://superuser.com/a/399660
Handle 没有发现 WhatsApp 锁定了临时文件夹中的 .tmp.node 文件。ProcessExplorer - 查找效果更好看这个答案https://superuser.com/a/399660
回答by Augustas
In my case Handle.exe
did not help.
Simple program from official Microsoft called Process Explorerwas useful.
Just open as administrator and press Ctrl+f
, type part of file name it will show process using file.
在我的情况下Handle.exe
没有帮助。来自微软官方称为Process Explorer 的简单程序很有用。只需以管理员身份打开并按Ctrl+f
,输入文件名的一部分,它将显示使用文件的进程。
回答by gwnp
I have used Unlockerfor years and really like it. It not only will identify programs and offer to unlock the folder\file, it will allow you to kill the processing that has the lock as well.
我已经使用Unlocker多年并且非常喜欢它。它不仅会识别程序并提供解锁文件夹\文件,它还允许您终止具有锁定的处理。
Additionally, it offers actions to do to the locked file in question such as deleting it.
此外,它还提供对有问题的锁定文件执行的操作,例如删除它。
Unlocker helps delete locked files with error messages including "cannot delete file," and "access is denied." Video tutorial available.
Some errors you might get that Unlocker can help with include:
- Cannot delete file: Access is denied.
- There has been a sharing violation.
- The source or destination file may be in use.
- The file is in use by another program or user.
- Make sure the disk is not full or write-protected and that the file is not currently in use.
Unlocker 可帮助删除带有错误消息的锁定文件,包括“无法删除文件”和“访问被拒绝”。提供视频教程。
Unlocker 可以帮助您解决的一些错误包括:
- 无法删除文件:访问被拒绝。
- 存在共享违规。
- 源文件或目标文件可能正在使用中。
- 该文件正被另一个程序或用户使用。
- 确保磁盘未满或未受写保护,并且当前未使用该文件。