Many times you may launch a program or process from within script using the 'Shell' command. You really want to wait until you know that the process has run. We all know that the return value only lets us know if it successfully launched the process - not if the process was completed. If you know it takes a period of time to complete that process, add a loop in your script program using the Timer() function to make the script program wait for a periodof time. The Timer function returns the number of seconds since Midnight. The example below launches a bat file and waits for 60 seconds before continuing the script code.
Dim iReturn As Integer Dim sglTime As Single Dim sglWait As Single '//launches a bat file iReturn = Shell("d:notesftpln.bat") '//gets the current number of seconds since midnight sglTime = Timer() sglWait = sglTime + 60 '//add the number of seconds you want to wait to the sglTime '//force the system into waiting 60 seconds before continuing '//this loop will continue until the current number of seconds is greater than the 'sglwait' value Do Until sglTime > sglWait sglTime = Timer() Loop