Solved

Windows 2000 Task Scheduler (HARD)

Posted on 2002-05-06
12
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

734 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