Hi,
We're using VFP8 and the following code to copy a folder:
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFSO.copyfolder(source, destination,.F.)
and it works fine until such time as somebody is editing one of the files contained in the folder, at which point we get a "COM command failed to execute" error. Rather than getting this message, what we want to do is trap that error and let the user know that the process cannot continue because files are in use.
I was hoping that the "copyfolder" method might return some sort of error reason code that we could trap and then act accordingly, but as far as I can see that does not appear to be the case... Is there any way of getting the method to return something more useful than "COM command failed to execute"?
Thanks in advance for any advice.
We're using VFP8 and the following code to copy a folder:
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFSO.copyfolder(source, destination,.F.)
and it works fine until such time as somebody is editing one of the files contained in the folder, at which point we get a "COM command failed to execute" error. Rather than getting this message, what we want to do is trap that error and let the user know that the process cannot continue because files are in use.
I was hoping that the "copyfolder" method might return some sort of error reason code that we could trap and then act accordingly, but as far as I can see that does not appear to be the case... Is there any way of getting the method to return something more useful than "COM command failed to execute"?
Thanks in advance for any advice.