'On a network, using VBA how to find the machine where a file is open
Sometimes I need to open a file that is already open, and I would like to close it. For that I need to know which machine on the network has it open.
How would I do that in VBA?
Thank you
Solution 1:[1]
To close files, you don't need to know what machine on the network has it open. What gave you that idea? What method are you thinking of using to force the file closed?
For example, the 'openfiles' cmd, which closes open files, (executed by running a command shell), does not require the machine from which the file is held open: only the network path to the file (the machine on which the file is stored).
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/openfiles
script example:
"cmd /k Openfiles /disconnect /S " & myServerName & " /U Administrator /P " & myPassword & " /ID "
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | david |
