|
-
Nov 20th, 2002, 02:58 PM
#1
Thread Starter
Frenzied Member
NetScheduleJobEnum in VB
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
-
Nov 7th, 2003, 02:55 AM
#2
Addicted Member
hi .. i also want to submit task through VB .. how i can invoke it from VB ?? did u get its full functioning code and APIs ??
-
Nov 8th, 2003, 12:07 AM
#3
Thread Starter
Frenzied Member
Wow, that was a long time ago. I did eventually finsh that project, but I don't have the code anymore, I left it with the client and forgot to keep a copy. I found the code originally when searching google. There was a Chineese or Japaneese firm that did it, but of course, the comments and function names weren't in readable english. There was someone online that had rewritten part of it in English, but only part. I eventually got the rest working, at least the rest that I needed. Do some searching on google and don't jump right over the foriegn sites. Remember google can translate websites...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|