Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Task Scheduler API? 1

Status
Not open for further replies.

vbtutor

Programmer
Sep 9, 2002
7
US
I need to either find the path and file structure/format information that Windows Task Scheduler uses to run Scheduled Tasks so that I can create a file that the Task Scheduler will automatically read and process. Or have an API call to the scheduler from within Visual Basic 6.0 so that automated processes I am creating in an application will get run.

Any suggestions?

Thanks,

David
 
Hi Giddo,
Thanks for the source code.Sorry to disappoint you but u still have one problem to solve for me.I had written earlier also in the thread :

"Can u please tell me how to schedule a task daily & set its advanced properties like setting repeat task details?
Code sample in VB will be highly appreciated.."


Your source code helps in creating tasks to be scheduled monthly/weekly but there is no provision to schedule task daily & also how to set its advanced properties like repeating the task after 2 min...

A quick response will be highly appreciated...
Thanks in Advance....

eCGsoft
 
Ok you can set it up daily, say if you want a task to start every day at 12:00 you put in M,T,W,TH,F,S,SU as the date and say every.


Does that make sense?

AS for doing every minute I will look into it.
 
Thanks Giddo....
It certainly makes sense (put in M,T,W,TH,F,S,SU as the date and say every day)...

I have already tried it & it works ...

The problem remains of setting the advanced properties like repeat the task every two minutes....

eCGsoft
 
See easy when you know how isn't it I will look into the repeat every x minutes and get back to you.

Regards

Neil Giddings
 
What about Windows 95/98/ME compatibility???

Are there any other API's that will work for older operating systems as well as the NetScheduleJobAdd API?
 
Hi!

Excellent thread. There is one more thing which I need to find out. How do I execute a currently present task that's already in the schedule? Execute it as in run it right away without waiting for the scheduled time to arrive.

Any ideas?

//Yujin
 
Hello,

This is an excellent post and has been of great help. What happens when a user changes their Windows Login password. The scheduled task doesn't know the password changed to it doesn't run. Anyway to fix this automatically?

Thanks.

Adzi
 
This thread has helped me out tremendously...So thanks to all...

My question is...
Is there a way to store a job name through the NetScheduleJobAdd API....I don't see it in the at_info structure...
Any help would be appretiated...
BG
 
I beleive the NetScheduleJobAdd API creates the job as a local System account...
 
Good thread all - I am having a similar issue - I need to schedule a job to run every 3 months using visual basic - so far no luck. Does anyone have any idea how to do that?

Thanks in advance...
 
Is there a way to programatically add a user credentials to a scheduled task.
 
I have got one more for the list.

How do you set up a task to run only the once but on a specific day of the month?

The only way I can get a task to only run once is on the same day at a specific time.

Good luck to anyone who want to attempt this.
 
I think I understand how to use Giddo's programme, except... what is lngJobID?, apparently not simply the path to the executable to be scheduled.
 
Hi.. I tried the code posted by SBendBuckeye
and after a little tweaking it worked. However, what variables do I need to plug in? Such as program name that I want to schedule? When I view the scheduler, it shows the scheduled jobs as "AT1", "AT2" etc..
What do the variables you listed stand for? (IE t,d,c,i,p)
To quote Johnny 5, "Need more input!!"
Thanks..
 
Hi Guys -

I am new to this forum this. Last night I were checking some information regarding setting a task throguh VB, I found very usefull information from this site.

My Question:
I found a VB example at planet source code for schedule task. The code works fine except it doesn't send the user ID and password to the windows scheduler. How can I send user information to the scheduler.

I am trying to schedule ACCPAC Financial report using VB code. If I don't send the user information it dosen't run the report properly.

Would RELLY appreciate if someone can help me.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top