Solved

Windows 2000 Task Scheduler (HARD)

Posted on 2002-05-06
12
294 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now