I have developed a small app. in Visual Studio 2008 and vb.net, where users can create scheduled tasks to run reports at selected times from another application. I have used TaskScheduler 1.0 and The Code Project's Task Scheduler Class Library for .NET for both Vista and XP installations. This all works fine and the scheduled tasks run with no problems. My problem is the code that deletes a scheduled task on request but which does not delete the task. Any ideas please? (code attached). I don't get any errors when the sub runs and I can see the the Task names in the Windows\Tasks folder.
Dim st As ScheduledTasks = New ScheduledTasks
Dim taskNames = st.GetTaskNames
Dim name As String
For Each name In taskNames
If name = "MyFirst.job" Or name = "MySecond.job" Then
Dim t As Task = st.OpenTask(name)