I have as part of a VBS log on script a need to copy a folder to a
users profile.
I want to ensure that the folder and its contents have been copied
before continuing with the script.
Any ideas how I can achieve this?

Re: Wait for FSO.CopyFolder to complete before continuing by pjglick

pjglick
Thu May 17 12:02:41 CDT 2007

You could run the vbscript as a separate script and shell out to the
script with wait on return.


Re: Wait for FSO.CopyFolder to complete before continuing by Michael

Michael
Thu May 17 18:48:19 CDT 2007

julian.brunt@gmail.com wrote:
> I have as part of a VBS log on script a need to copy a folder to a
> users profile.
> I want to ensure that the folder and its contents have been copied
> before continuing with the script.
> Any ideas how I can achieve this?

FSO methods used to copy files/folders (Copy, CopyFile, CopyFolder) are all
synchronous meaning your script blocks on the method call unitl it is 100%
complete (or throws an error).

Perhaps you are using 'On Error Resume Next' a bit too liberally and it only
*appears* that the script continues with CopyWhatever still in progress.

--
Michael Harris
Microsoft.MVP.Scripting