This project has moved and is read-only. For the latest updates, please go here.

Get unique id for task

Topics: Examples
Nov 2, 2016 at 9:48 PM
Is there a property that gives a unique ID for a specific task? Specifically of type Microsoft.Win32.TaskScheduler.Task.
Using ts As New TaskService()

            Dim taskArr As IEnumerable(Of Task) = ts.AllTasks

            For Each task As Task In taskArr
                              'Get unique ID here. Does something like the following exist?
                               Console.WriteLine(task.GetUniqueID())
            Next

End Using
My goal is to go through the tasks and save the information to a database with a unique identifier. That way if the task name changes or any other information about it, I can still connect it with my table in the database.

Is this possible?
Coordinator
Nov 3, 2016 at 4:45 PM
There is not a Guid or other ID tied to each registered task. What does have to be unique is the Path property. You could either use that or create a hash of it.
Marked as answer by dahall on 11/7/2016 at 8:10 PM