1

Im having trouble getting the list of scheduled tasks for some servers where the scheduled tasks are located C:WINDOWS\System32\Tasks, the following code works if the scheduled tasks are located C:\WINDOWS\Tasks, how do I get the list of schedules tasks if they are located in the different folder?

Dim oScheduledTasks As ScheduledTasks
Try : oScheduledTasks = New ScheduledTasks("\\axisdev02")

Catch ex As Exception

End Try

Dim arrTasks() As String
Dim oTask As Task
arrTasks = oScheduledTasks.GetTaskNames

For Each t In arrTasks
  oTask = oScheduledTasks.OpenTask(t)
  Console.WriteLine("Name : " & oTask.Name)
Next

Console.ReadKey()
Irfan
  • 2,713
  • 3
  • 29
  • 43
  • You appear to be using the ScheduledTask library from the Office.Excel library, correct? Have you considered using the TaskScheduler as described [here](http://stackoverflow.com/questions/7394806/creating-scheduled-tasks)? – Adrian Aug 22 '13 at 22:52

0 Answers0