Has anyone successfully used this in VB?
I can use NetScheduleJobAdd to add a task to the task scheduler through VB, but I cannot find a way to list all the tasks.
This is what I am trying to call.
The call returns successfully, but I don't know how to get all the values out of udtAtInfo.
It seams that it should return an array of these, but I am lost.
VB Code:
'In form lngWin32apiResultCode = NetScheduleJobEnum("", udtAtInfo, MAX_PREFERRED_LENGTH, lOutEntriesRead, lOutTotal, 0) 'In module Declare Function NetScheduleJobAdd Lib "netapi32.dll" (ByVal Servername As String, Buffer As Any, JobId As Long) As Long Declare Function NetScheduleJobEnum Lib "netapi32.dll" (ByVal Servername As String, Buffer As Any, PreferredMaximumLength As Long, EntriesRead As Long, TotalEntries As Long, ResumeHandle As Long) As Long ' Schedule structure Type AT_INFO JobId As Long JobTime As Long DaysOfMonth As Long DaysOfWeek As Byte Flags As Byte dummy As Integer Command As String End Type ' Schedule constants Public Const JOB_RUN_PERIODICALLY = &H1 Public Const JOB_NONINTERACTIVE = &H10 Public Const NERR_Success = 0 Public Const MAX_PREFERRED_LENGTH As Long = -1




I drink to make other people more interesting!
Reply With Quote