Consider the following options: 1. Create a job template using the Template Builder tool. You can then use the template to generate all other jobs. The pros of that method are that you write your script only once and put all common jobs settings into the template also only once. You can then create new jobs from that template by answering only a few questions. The cons are that every new job will get a copy of that script and if you need to change something you will need to change it in all places. 2. Save your script in an external file (any extension). In 24x7 jobs use @SCRIPT tag to refer to the file. A typical job script could look like Dim my_job_name my_job_name = "xyz" @SCRIPT:c:\scripts\jobscript.vbs Of course the referenced file must make use of the my_job_name variable. The pros of that method are that you write your script only once and maintain it on one place. The cons are that the script is stored off-line and not secured. Anyone who has access to the directory can change it. 3. Create new user-defined statement in the Script Library. Script library currently supports JAL scripts only, but you can use VBScriptRun command from JAL to execute your VBScript. Every job will simple have a single line script like RunMyVBScript( "job parameter") where RunMyVBScript is the name of the user-defined statement and "job parameter" is the parameter you want to pass to the job. The pros of that method are that you write your script only once and maintain it on one place. It is stored on-line and secured. The cons are that the script is executed as bunch of text and writing a long VBScript in this form is not really convenient. You cannot also debug it using the built-in VBScript debugger. You are limited to MsgBox or logging as debugging methods. Hope this helps. : I'm looking to build a VBS template that can be called/executed : externally or an interanal script from the scheduler. I have many : scripts/jobs : that are run but the only change is the @job_name in each script. : Rather than make copies of a template with a new job name and make changes : to all jobs when i need to make a template change i want to make just the : changes to the template which is called/executed. : Example with jobname: Job1 : Job2 : Job1 will call/execute a template VBS script as : Job1. : Job2 will call/execute a template VBS script as : Job2. etc.
|