如何确定哪个程序在VB 2005中使用文件?

时间:2021-06-02 02:23:42

Is there a way to get the program that is locking a file, in vb 2005?

在vb 2005中有没有办法获取锁定文件的程序?

For instance, when I try to open a file that is already opened by another program, can I get the name of the process/program that has locked this file?

例如,当我尝试打开另一个程序已经打开的文件时,是否可以获取已锁定此文件的进程/程序的名称?

1 个解决方案

#1


System Internals has a tool called Handle that you can use. It tells you which program has what file and/or directory open. It is a console application. You can pipe its output to a text file and then simply open that text file and search for the file you're looking for. Then you can see which process has it open.

System Internals有一个名为Handle的工具,您可以使用它。它告诉您哪个程序打开了哪个文件和/或目录。它是一个控制台应用程序。您可以将其输出通过管道传输到文本文件,然后只需打开该文本文件并搜索您要查找的文件。然后你可以看到它打开了哪个进程。

c:\handle > output.txt

#1


System Internals has a tool called Handle that you can use. It tells you which program has what file and/or directory open. It is a console application. You can pipe its output to a text file and then simply open that text file and search for the file you're looking for. Then you can see which process has it open.

System Internals有一个名为Handle的工具,您可以使用它。它告诉您哪个程序打开了哪个文件和/或目录。它是一个控制台应用程序。您可以将其输出通过管道传输到文本文件,然后只需打开该文本文件并搜索您要查找的文件。然后你可以看到它打开了哪个进程。

c:\handle > output.txt