Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

New Post: Get a list of tasks, descriptions and triggers into a datagrid

$
0
0
Hi guys, I'm pretty new to coding and am trying to write a small app which shows a list of all the scheduled tasks on the local machine, along with the description and scheduled execution date/time. I'd like to have this info in a datagridview.

I've been trying to use the below code to get a list of the tasks, but I'm not sure what to do in the "do something here". What do I need to do now to get that info out?

I should mention I'm using VB.
Private Sub EnumAllTasks()
        Using ts As New TaskService()
            EnumFolderTasks(ts.RootFolder)
        End Using
    End Sub

    Private Sub EnumFolderTasks(ByVal fld As TaskFolder)
        For Each task As Task In fld.Tasks
            ActOnTask(task)

        Next task
        For Each sfld As TaskFolder In fld.SubFolders
            EnumFolderTasks(sfld)
        Next sfld
    End Sub

    Private Sub ActOnTask(ByVal t As Task)
        'do something here
    End Sub

Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>