The following example shows the use of ITPDS.Job from VB Script (Microsoft Windows Scripting Host):
Dim objItpdsJob
Dim blnRc
' Create an ITPDS.Job instance
Set objItpdsJob = WScript.CreateObject("ITPDS.Job","ITPDSEvents_")
' Set the basic properties
objItpdsJob.Host = "itpdssrv.company.com"
objItpdsJob.Port = "3001"
objItpdsJob.JobID = "Test1"
' Set ITP/Server extended properties
objItpdsJob.ReceiveFile = True
objItpdsJob.SendFile = True
objItpdsJob.ExchangeData = True
objItpdsJob.ConfirmCompletion = True
' Set the Job parameters
objItpdsJob.AddParameter("Name of the requested service")
objItpdsJob.AddParameter("par2")
objItpdsJob.AddParameter("par3")
' Make sure we receive errors
On Error Resume Next
' Submit the job synchronously
blnRc = objItpdsJob.Submit(True)
' Check the return code
If Not blnRc Then
' Error info is available in global Err object
MsgBox ("Error #" & Hex(Err.Number) & " " & Err.Description)
Err.Clear
End If
Sub ITPDSEvents_Progress(s)
MsgBox (s)
End Sub
Sub ITPDSEvents_VerifySend(s)
MsgBox ("Verify Send: " & s)
objItpdsJob.RespondVerifySend(s)
End Sub
Sub ITPDSEvents_VerifyReceive(s)
MsgBox ("Verify Receive: " & s)
objItpdsJob.RespondVerifyReceive(s)
End Sub
Sub ITPDSEvents_ExchangeData(k, v)
MsgBox ("ExchangeData: " & k & " - " & v)
objItpdsJob.RespondExchangeData "[" & k & "->" & v & "]"
End Sub