Creates a task from data in an XML file.

For schema of XML file, see Task Schema.

Visual Basic
Edit|Remove
strClusterName = "localhost" 'Change to name of cluster if not run locally.
strXMLFilePath = "c:\scripts\tasktemplate.xml"
Set objComputeCluster = CreateObject("Microsoft.ComputeCluster.Cluster")
objComputeCluster.Connect(strClusterName)
WScript.Echo "Compute Cluster Name: " & objComputeCluster.Name

'Create task.
Set objTask = objComputeCluster.CreateTaskFromXmlFile(strXMLFilePath)
WScript.Echo "Task Name: " & objTask.Name
WScript.Echo "Command Line: " & objTask.CommandLine
WScript.Echo "Runtime: " & objTask.Runtime
WScript.Echo "Maximum Number Of Processors: " & _
    objTask.MaximumNumberOfProcessors
WScript.Echo "Minimum Number Of Processors: " & _
    objTask.MinimumNumberOfProcessors
WScript.Echo "Is Exclusive: " & objTask.IsExclusive
WScript.Echo "Is Rerunnable: " & objTask.IsRerunnable
WScript.Echo "STDOUT: " & objTask.Stdout
WScript.Echo "STDERR: " & objTask.Stderr
WScript.Echo "Work Directory: " & objTask.WorkDirectory