Re: pause until command completes before next command

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




<sheel331@xxxxxxxxx> wrote in message
news:50383f89-df4e-4532-b9e2-1004c3458ce2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,

In VBScript, is there a way to pause the script from executing a
command until the previous command is complete? I know in
wshshell.run, you can have the ",,true" option, but what about for
another command, specifically a copyfolder command?

I have a command the copies a folder to a backup location and then
manipulates it right afterwards. Currently, what I am doing is after
the copyfolder command is executed, I sleep for 5 seconds. Most of the
time, this works, but for some larger folders which takes longer than
5 seconds to copy, the script will error out.

Is there a way to do what I want?

Thanks in advance,
Sheel Shah

As far as I know, the method
FileSystemObject.CopyFolder "c:\mydocuments\letters\*", "c:\tempfolder\"
will complete the copy process before continuing with the next
line of code.


.



Relevant Pages