Results 1 to 4 of 4

Thread: [02/03] Adding A Scheduled Task

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    [02/03] Adding A Scheduled Task

    Ok this problem quiet simply is making me feel extremely stupid.

    All i want to do is allow my program to be added to the scheduled tasks list.

    I know i have to use the NetScheduleJobAdd function in the netapi32.dll, but I can't figure it out for the life of me.
    Any relevant code I have found works only in VB6.

    ANY help would be awesome!

    Oh, a relevant MSDN link http://windowssdk.msdn.microsoft.com.../ms707146.aspx

    My god i feel retarded

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [02/03] Adding A Scheduled Task

    You can use schtasks.exe if you want. Just pass it to Process.Start with the appropriate commandline arguments. See Windows Help for more information or use the commandline "schtasks /?" to get the correct syntax.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    Re: [02/03] Adding A Scheduled Task

    Unfornately the way this network is set up I get access denied errors when the task tries to run :/

    Unable to start task.
    The specific error is:
    0x80070005: Access is denied.
    Try using the Task page Browse button to locate the application.

  4. #4
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: [02/03] Adding A Scheduled Task

    Well an administrator account is the only person that can schedule tasks (I believe), so when you try to start it are you sure that you are under an Admin account or admin user for that computer?

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