Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bundle and Schedule FTP scripts

Status
Not open for further replies.

vgwprja

Programmer
Mar 27, 2008
24
0
0
US
I have several VB scripts that need to be bundled and run in sequence. I would like to keep these scripts as separate entities but set to run under another script one at a time. How would I do that?

Also, what do I need to do in order to run a script on a job scheduler or as scheduled task?

Thank you.
 
If we assume each script to be an intact, runnable script the master script could run them externally in sequence via the Run method specifying bWaitOnReturn = True (3rd parameter of the Run method).

Windows Scheduler has a wizard for defining simple scheduled tasks and on some OSs provides tools for defining more complex scheduling. You can also use AT scheduling via the command line.

The most important things to remember here are (1.) you are scheduling a script host, not a script and (2.) you need to be specific about what user the task should run on and whether the user must be logged on.
 
So, would this be a correct assumption running 3 jobs?

'VBScript Run Reliance FTP, consists of 3 scripts in sequence
'syntax: object.Run (Command [, WindowStyle] [, WaitOnReturn])

Option Explicit
Set objShell = CreateObject("WScript.Shell")
objShell.Run "FirstJob.vbs,0,True)
objShell.Run "SecondJob.vbs,0,True)
objShell.Run "ThirdJob.vbs,0,True)
WScript.Quit

Thank you.
 
Replace this:
objShell.Run "FirstJob.vbs,0,True)
objShell.Run "SecondJob.vbs,0,True)
objShell.Run "ThirdJob.vbs,0,True)
with this:
objShell.Run "FirstJob.vbs",0,True
objShell.Run "SecondJob.vbs",0,True
objShell.Run "ThirdJob.vbs",0,True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That really helped and I'm able to run all my scripts inside the "main script". Last question, how would I tell the "main" script where to locate my scripts? They are in folder "e:\ftpscript. Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top