Page 1 of 2 12>
Topic Options
#67781 - 2002-07-03 07:49 PM Wanted - Object task scheduler functions
New Mexico Mark Offline
Hey THIS is FUN
****

Registered: 2002-01-03
Posts: 223
Loc: Columbia, SC
I realize jens wrote a function to schedule a task using jt.exe. However, I need a more generalized interface. Specifically, I would like to be able to:

1. Schedule a task.
2. Extract all information about a task.
3. Enumerate all tasks.
4. Return missed tasks.

I didn't realize this was a need until I tried to create a report on all the tasks I have scheduled on my system for training a co-worker.

It seems that Microsoft is almost ashamed of jt.exe. I can't find any documentation, and it isn't included in the most Win2k Pro or Win2K supplement resource kits. Besides, an object-oriented approach would be more standardized and less prone to obsolescence.

If anyone is interested in working on this one, I'd be willing to help with the coding and testing.

New Mexico Mark

Top
#67782 - 2002-07-03 07:59 PM Re: Wanted - Object task scheduler functions
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
JT.EXE can do all this, if you're willing to go through the build-in documentation.
_________________________
There are two types of vessels, submarines and targets.

Top
#67783 - 2002-07-03 08:09 PM Re: Wanted - Object task scheduler functions
New Mexico Mark Offline
Hey THIS is FUN
****

Registered: 2002-01-03
Posts: 223
Loc: Columbia, SC
I started going through the built-in documentation, but I got frustrated when one command referenced help on SCE and jt /? SCE just returned the basic help. Arrrrggghh.

I'll pound on jt.exe a little more and see if I can get it to behave better.

Thanks,

NMM

Top
#67784 - 2002-07-03 08:43 PM Re: Wanted - Object task scheduler functions
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hmmm, theres a COM interface for Task Scheduler, but looks as if one has to jump through a bunch of hoops to get at it (or should I say - get it) ...

http://www.15seconds.com/Issue/980513.htm

-Shawn

Top
#67785 - 2002-07-03 08:44 PM Re: Wanted - Object task scheduler functions
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
The interesting thing about jt.exe is that you can do everything on a single commandline. You can create a job with the correct settings, add it to a computer, execute the job, and delete the job all in one line. I can spend some time on this if you'd like Mark.

Brian

Top
#67786 - 2002-07-03 08:52 PM Re: Wanted - Object task scheduler functions
New Mexico Mark Offline
Hey THIS is FUN
****

Registered: 2002-01-03
Posts: 223
Loc: Columbia, SC
I'd appreciate the help, Brian. It looks like /SCE is a critical argument in jt.exe, but it is undocumented.

Another reason I lean toward using the actual task scheduler object (if possible... I'll do more research) is that it doesn't require having another executable in the user's path.

Top
#67787 - 2002-07-03 08:54 PM Re: Wanted - Object task scheduler functions
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
I think the object is usable.. I'll work out some sample code for you.

Brian

Top
#67788 - 2002-07-03 09:11 PM Re: Wanted - Object task scheduler functions
New Mexico Mark Offline
Hey THIS is FUN
****

Registered: 2002-01-03
Posts: 223
Loc: Columbia, SC
The method shown in the web page Shawn referenced is giving me fits.

Server.CreateObject(""Scheduler.ShedulingAgent.1"") is a strange construction. Not to mention that KiXtart insists on interpreting the CreateObject after the period as the CreateObject function instead of a method of the $oServer object I created.

Top
#67789 - 2002-07-03 09:18 PM Re: Wanted - Object task scheduler functions
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Mark

Might want to try just the CreateObject by itself:

$Sched = CreateObject("Scheduler.ShedulingAgent.1")

But I would suggest a manual search in the root of HKEY_CLASSES_ROOT for the value "Scheduler.ShedulingAgent.1" - just to make sure its installed (just checked my XP machine - not there)

According to the web site there - the COMable DLL (TaskScheduler.dll) ships with Site Server [Frown]

[ 03 July 2002, 21:20: Message edited by: Shawn ]

Top
#67790 - 2002-07-03 09:20 PM Re: Wanted - Object task scheduler functions
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
I'm fiddling with it... apparently we need the server (asp) object functional.. still working on that.

Brian

Top
#67791 - 2002-07-03 09:52 PM Re: Wanted - Object task scheduler functions
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
So far no luck on the COM methods... still messing with it, though.

Brian

Top
#67792 - 2002-07-03 10:20 PM Re: Wanted - Object task scheduler functions
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
This looks pretty interesting..

http://cwashington.netreach.net/depo/view.asp?Index=496&ScriptType=vbscript
Uses a custom object from - http://home.sprintmail.com/~mpryor/

Prowling around on MSDN, we only see examples in C++ and not VB..

Hmm..

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#67793 - 2002-07-03 10:31 PM Re: Wanted - Object task scheduler functions
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Phooey.. trying to find info on how to do this in COM seems tougher than manipulating JT.exe! [Smile]

Brian

Top
#67794 - 2002-07-03 10:31 PM Re: Wanted - Object task scheduler functions
New Mexico Mark Offline
Hey THIS is FUN
****

Registered: 2002-01-03
Posts: 223
Loc: Columbia, SC
Gone for day... not ignoring anyone. Will be back Friday. Thanks!
Top
#67795 - 2002-07-03 10:50 PM Re: Wanted - Object task scheduler functions
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
After reading this, I think I may stick to jt.exe:

http://listserv.activestate.com/pipermail/perl-win32-users/2000-June/000404.html

Brian

Top
#67796 - 2002-07-03 11:17 PM Re: Wanted - Object task scheduler functions
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Actually.. I have seen two different ActiveX wrappers for the task scheduler functions (in addition to the freeware one listed above):

1. http://www.etasoft.com/

2. http://www.altecdata.com/task_scheduler.htm

I wonder how hard it would be to write one of these..

Brian

[ 03 July 2002, 23:20: Message edited by: BrianTX ]

Top
#67797 - 2002-07-03 11:23 PM Re: Wanted - Object task scheduler functions
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Probably pretty easy - just rip the interface from one of those pricey ActiveX controls ... hmmm, thats got me to thinking, wonder if COM interfaces are "Copyright-able" - probably not - the implementation would be copyrighted software, but the interface itself ??? hmmm ... maybe ...
Top
#67798 - 2002-07-03 11:44 PM Re: Wanted - Object task scheduler functions
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Did you get a chance to see this implementation?

http://home.sprintmail.com/~mpryor/tskfaq.htm

Here are KB's with regard to the Task Scheduler

http://home.sprintmail.com/~mpryor/makeKB.htm

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#67799 - 2002-07-03 11:48 PM Re: Wanted - Object task scheduler functions
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Now all I need is GCC to compile some C++ code.. (since I don't have visual C++) I noticed there is a lot of sample code on the MSDN site.

Brian

Top
#67800 - 2002-07-03 11:51 PM Re: Wanted - Object task scheduler functions
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Here is some more with this..

Ref - http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=32831&lngWId=1
quote:

Allows you to use the windows task scheduler service to schedule task to run on the system.
This code was written in Japanese by another company and I re-wrote it in English.
It took me a while to find this one so I hope you all appreciate the research time
that has been put into doing this. Hope it's off use to some of you out there.
If you want to vote for this code please do so.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.076 seconds in which 0.029 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org