Is there any way to call the individual job id's in a main job in a
wsf file .
See example below, I want to call job GetBuild and InstallBuild in job
id "Main". Is it possible and what is the syntax.

<?XML Version="1.0"?>
<?job Error="true" Debug="true"?>
<package>
<job id="Main">
<script language="VBScript">
<![CDATA[
Call JOBID GetBuild
Call JOBID InstallBuild
]]>
</script>
</job>

<job id="GetBuild">
<script language="VBScript" src="Functions.vbs"/>
<script language="VBScript" src="GetBuild.vbs"/>
<script language="VBScript">
<![CDATA[
Set oshell = CreateObject("wscript.shell")
Set ofs = CreateObject("Scripting.FileSystemObject")

Call Function
]]>
</script>
</job>

<job id="InstallBuild">
<script language="VBScript" src="Functions.vbs"/>
<script language="VBScript" src="InstallBuild.vbs"/>
<script language="VBScript">
<![CDATA[
Set oshell = CreateObject("wscript.shell")
Set ofs = CreateObject("Scripting.FileSystemObject")

Call Function
]]>
</script>
</job>
</package>

Regards,
Gert Jan

Re: More job id's in wsf file by mr_unreliable

mr_unreliable
Mon Jul 21 10:51:17 CDT 2008

thegjs wrote:
> Is there any way to call the individual job id's in a main job in a
> wsf file .

hi Gert Jan,

The documentation suggests doing it like this:

--- <code> ---
<?XML Version="1.0"?>
<?job Error="true" Debug="true"?>
<package>
<job id="Main">
<script language="VBScript">
<![CDATA[
sMe = Wscript.ScriptFullName ' : MsgBox(sMe)
Const bWaitOnReturn = True
Set oSH = WScript.CreateObject("WScript.Shell")
' run job2
oSH.Run "wscript.exe " & sMe & " //job:myJob2",,bWaitOnReturn
' run job3
oSH.Run "wscript.exe " & sMe & " //job:myJob3",,bWaitOnReturn
MsgBox("Main job has finished running jobs 1&2.. ")

]]>
</script>
</job>

<job id="myJob2">
<script language="VBScript">
<![CDATA[
MsgBox("Hello, from JOB_TWO!!! ")

]]>
</script>
</job>

<job id="myJob3">
<script language="VBScript">
<![CDATA[
MsgBox("Hello, from JOB_THREE!!! ")

]]>
</script>
</job>
</package>
--- </code> ---

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)


Re: More job id's in wsf file by Steve

Steve
Mon Jul 21 11:52:18 CDT 2008

thegjs wrote:
> Is there any way to call the individual job id's in a main job in a
> wsf file .
> I want to call job GetBuild and InstallBuild in job
> id "Main". Is it possible and what is the syntax.

The only way I found to do this is to reinvoke the package, specifying
the jobs you want to run in the command line:

<job id="Main">
<script language="VBScript">
<![CDATA[
CreateObject("WScript.Shell")\.Run _
WScript.FullName & " " & WScript.ScriptFullName & _
" //job:GetBuild //job:InstallBuild", 0, True
]]>
</script>
</job>

--
Steve

The first method for estimating the intelligence of a ruler is to look
at the men he has around him. -Niccolo Machiavelli