interface to win job scheduler portable from win98 .. winXP / cmdline or COM ?

Robert k.robert at gmx.de
Wed Jan 21 07:25:21 EST 2004


this COM interface seems to be right for my problem. but I don't get a
handle on it.
I am only familiar with things like
o=win32com.client.Dispatch("Excel.Application") and navigate.
Is it possible this way? I didn't find anywhere a hint for such
exported Class Name.
I only found a "CLSID" and know little about that. I tried the
following. But he says "interface not supported" but seems that he
finds anything ... ?


>>> from win32com.client import Dispatch
>>> Dispatch("{148BD520-A2AB-11CE-B11F-00AA00530503}")
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\PYTHON23\lib\site-packages\win32com\client\__init__.py",
line 95, in Dispatch
    dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\PYTHON23\lib\site-packages\win32com\client\dynamic.py",
line 85, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\PYTHON23\lib\site-packages\win32com\client\dynamic.py",
line 73, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
com_error: (-2147467262, 'Schnittstelle nicht unterst\xfctzt', None,
None)



Robert


Thomas Heller <theller at python.net> wrote in message news:<r7xuna4l.fsf at python.net>...
> Tim Golden <tim.golden at viacom-outdoor.co.uk> writes:
> 
> >>From: Robert [mailto:k.robert at gmx.de]
> >>
> >>I found the os.popen("AT /?") way ....  however it works not on Win98
> >>and the "Day" you enter at the AT are language dependent.
> >>(e.g. Mi(ttwoch) in german, We(dnesday) in english Windows versions)
> >>
> >>I need a solution work from Win98..WinXP most independent from
> >>internationalization etc.
> >>
> >>is there portable way - or at all a way to manipulate the Win98/ME
> >>scheduler ?  if no simple means, even COM stuff would be ok.  any
> >>pointers?
> >>
> >
> > WMI looks like it covers it, but only NT4 / Win2K / XP.
> > Oh, sorry, I've just realised: the Win32_ScheduledJob 
> > actually refers to the AT service (despite the name!)
> >
> > If you're really looking for something which will work
> > across every version of Windows, I think you're better
> > off doing something entirely Python from the start. It
> > shouldn't be hard (he says, having not tried it himself). 
> > The advantage is: it will work everywhere and you have 
> > complete control over it. The disadvantage is: you have 
> > to create your own interface and deal with whatever 
> > issues the existing mechanisms have already dealt with.
> 
> I'll second that this is most certainly the easiest solution.
> 
> There seems to be, however, a COM interface to the Task Scheduler, using
> all custom interfaces:
> 
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/taskschd/taskschd/task_scheduler_start_page.asp>
> 
> As usual, the docs aren't that crystal clear, but I get the impression
> that it's even available in win 95, provided that IE4 is installed.
> 
> Thomas



More information about the Python-list mailing list