[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
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.
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.
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?