Solved

Windows 2000 Task Scheduler (HARD)

Posted on 2002-05-06
12
297 Views
Last Modified: 2012-05-07
Hello,

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.


0
Comment
Question by:perlita
  • 7
  • 2
  • 2
  • +1
12 Comments
 
LVL 1

Expert Comment

by:delloro
ID: 6993192
<listening>
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6993283
If only they'd used an ini file?
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6993285
If nobody has the answer maybe you could post the code and we could translate into VB.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:krisjob
ID: 6994614
Why do you not want to use the AT command?
0
 

Author Comment

by:perlita
ID: 6995225
Because I want to do this programmatically.
and also I believe that the AT command cannot
set the task to run as a user.
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6995458
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.
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6995488
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.

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/taskschd/ts_itaskscheduler_9cfm.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/taskschd/ts_about_5js9.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/taskschd/ts_ienumworkitems_738z.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/taskschd/ts_glossary_6um1.asp

back later.....
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6995506
Looks like a Perl or something definition which is closer to VB than C++ defs.

http://www.orionis.com.mx/tallerdelphi/td06_4a.htm
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6995527
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.....
0
 
LVL 1

Accepted Solution

by:
delloro earned 300 total points
ID: 6995544
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.

http://www.domaindlx.com/e_morcillo/

(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
similiar.

Good Luck.


0
 

Author Comment

by:perlita
ID: 6995550
Thanx.

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

0
 
LVL 17

Expert Comment

by:inthedark
ID: 6995943
Nice link delloro...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question