Keith Tizzard
2023-02-15 16:37:24 UTC
In my application I need to access the file system to carry out a number of activities.
There is a folder (orginalQuoteFolder) that contains a number of subfolders, many of which contain files.
I need to move this folder to a new location (newQuoteFolder) using something like:
Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.movefolder originalQuoteFolder, newQuoteFolder
' move the Quote folder
Set FSO = Nothing
This usually works but the client says that it occasionally fails. They claim, although I have not seen the evidence, that this is because one or more of the contained files is open by another user.
Q1: Is this likely to be true?
i.e is it only possible to move a folder if all its contained files are closed?
Q2: If the move fails for this reason, how can one determine which file is open and which user has opened it?
There is a folder (orginalQuoteFolder) that contains a number of subfolders, many of which contain files.
I need to move this folder to a new location (newQuoteFolder) using something like:
Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.movefolder originalQuoteFolder, newQuoteFolder
' move the Quote folder
Set FSO = Nothing
This usually works but the client says that it occasionally fails. They claim, although I have not seen the evidence, that this is because one or more of the contained files is open by another user.
Q1: Is this likely to be true?
i.e is it only possible to move a folder if all its contained files are closed?
Q2: If the move fails for this reason, how can one determine which file is open and which user has opened it?