Windows 2000 Task Scheduler (HARD)


Does anyone know how to access/add jobs with the Windows 2000 Task Scheduler ?

I need to be able to allocate a new task with a username and password to run at a specific time ?

I need the solution in Visual Basic. I have a solution in Delphi which uses CreateCoInstance and the ITaskScheduler interface....

Any help would be greatly appreciated.

I cannot use the API NetScheduleAdd/Del because it does
not allow me to specifiy a username and password.

I do not want to use the AT command as well.

Thanks in Advance.

Who is Participating?
delloroConnect With a Mentor Commented:
There is an example here which answers your question.

It is a Visual Basic Example of implementing the
task scheduler free and containing the source code.

(You will have to load some type libraries to run this)

It is very good code but not documented very well.

For some more documented active X control you can use:
Altec Data's Task Scheduler control which is very

Good Luck.

If only they'd used an ini file?
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

If nobody has the answer maybe you could post the code and we could translate into VB.
Why do you not want to use the AT command?
perlitaAuthor Commented:
Because I want to do this programmatically.
and also I believe that the AT command cannot
set the task to run as a user.
perlita, this would be a good one to get going. Only VB can be trusted to set up a backup schedule, if you leave the job to a human, without imagination, something terrible is going to happen.
Routing arround in a few places I found some c++ examples so it would be possible to convert to VB.

Firts we need to convert the definitions, if you have the full VS6 installed search on your hard disk for: mstask.h

Now for some head scratching...

The task api is documented, (in greek) within the MSDN.

back later.....
Looks like a Perl or something definition which is closer to VB than C++ defs.
I have not found any converted VB declarations for the Task Scheduler so it will take a long time to do.

It would be quicker to create an ActiveX DLL wrapper in C++, sadley that to is going to take a lot of time, more than I have right now.....
perlitaAuthor Commented:

The comment from Altec and Morcillo will be
enough for me.

Nice link delloro...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.