Cancels a specific task.

Visual Basic
Edit|Remove
strClusterName = "localhost" 'Change to name of cluster if not run locally.
intJobID = 3
intTaskID = 2
strMessage = "Task " & intTaskID & " in Job " & intJobID & _
 " cancelled because ..." 'Reason why cancelled
Set objComputeCluster = CreateObject("Microsoft.ComputeCluster.Cluster")
objComputeCluster.Connect(strClusterName)
WScript.Echo "Compute Cluster Name: " & objComputeCluster.Name
objComputeCluster.CancelTask intJobID, intTaskID, strMessage