Pregunta

I'm running a simple/single vbscript in Windows Scheduler to perform 13 individual file exports from our SalesForce app. The script runs as expected. Depending upon network traffic, the 13 exports take 3-5 minutes total to complete.

My intent was to run these exports serially, but vbscript seems happy to run them in parallel. SalesForce accommodates with no issue or complaint.

Upon successful completion of the Export, I run a second vbscript to import these results into another application (via an msaccess function). This second vbscript also provides the desired result.

Question: Is there any way to programatically determine when the Export script has completed, to permit me to safely kick-off the Import script? Currently I have setup a 2nd Scheduler job to run the Import script 10 minutes after the separate Export script...but this could fail. I am looking to tie these two script more closely to one another.

Any suggestions?

Thanks!

¿Fue útil?

Solución

There are a couple of options. If both scripts are running on the same system with the same permissions, you could have the first script actually kick off the second script whenever it's finished.

If the scripts require different permissions, or you need them to start from a task manager, have your first script start by looking for an existing file such as SCRIPT1.COMPLETE. If that file exists, have script1 delete the file and start processing. When script1 finishes it's processing, create that file. Then in script2, create a while loop that looks for SCRIPT1.COMPLETE. If the file is not there, hold off for a few seconds then try again. Don't exit the while loop until the complete file shows up. Have script2 delete the COMPLETE file when it finishes processing. I would recommend setting your "wait a while" function to at least 30 seconds or so, that way your script isn't just constantly checking.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top