Solved

Windows 2000 Task Scheduler (HARD)

Posted on 2002-05-06
12
292 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
Comment Utility
<listening>
0
 
LVL 17

Expert Comment

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

Expert Comment

by:inthedark
Comment Utility
If nobody has the answer maybe you could post the code and we could translate into VB.
0
 

Expert Comment

by:krisjob
Comment Utility
Why do you not want to use the AT command?
0
 

Author Comment

by:perlita
Comment Utility
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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 17

Expert Comment

by:inthedark
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanx.

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

0
 
LVL 17

Expert Comment

by:inthedark
Comment Utility
Nice link delloro...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

762 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

11 Experts available now in Live!

Get 1:1 Help Now