Results 1 to 3 of 3

Thread: NetScheduleJobEnum in VB

  1. #1

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141

    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:
    1. 'In form
    2.     lngWin32apiResultCode = NetScheduleJobEnum("", udtAtInfo, MAX_PREFERRED_LENGTH, lOutEntriesRead, lOutTotal, 0)
    3.  
    4. 'In module
    5. Declare Function NetScheduleJobAdd Lib "netapi32.dll" (ByVal Servername As String, Buffer As Any, JobId As Long) As Long
    6. 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
    7.  
    8. ' Schedule structure
    9. Type AT_INFO
    10.     JobId As Long
    11.     JobTime     As Long
    12.     DaysOfMonth As Long
    13.     DaysOfWeek  As Byte
    14.     Flags       As Byte
    15.     dummy       As Integer
    16.     Command     As String
    17. End Type
    18.  
    19. ' Schedule constants
    20. Public Const JOB_RUN_PERIODICALLY = &H1
    21. Public Const JOB_NONINTERACTIVE = &H10
    22. Public Const NERR_Success = 0
    23. Public Const MAX_PREFERRED_LENGTH As Long = -1
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  2. #2
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225
    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 ??
    Chander
    Email:[email protected]

  3. #3

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141
    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...
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width