LISTING 5: DeleteAllTasks.vbs
Option Explicit
Dim strClientName, objWMI, objTask
BEGIN COMMENT
' Change localhost to the name of the client to which you
‘ want to connect.
END COMMENT
strClientName = "localhost"
Set objWMI = GetObject("winmgmts://" & _
strClientName).InstancesOf("win32_scheduledjob")
For Each objTask In objWMI
objTask.Delete
Next