Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
800A01AD error when creating Schedule.Service object
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
 
View profile  
 More options Oct 20 2009, 8:45 pm
Newsgroups: microsoft.public.scripting.vbscript
From: munawar rashid
Date: Tue, 20 Oct 2009 13:45:37 -0700
Local: Tues, Oct 20 2009 8:45 pm
Subject: 800A01AD error when creating Schedule.Service object
Hi

I'm terying to programmatically determine information about scheduled task running in a Windows Server 2003 SP1 machine. I've created a vbscript (it will be run locally) which is failing at the following line

Set service = CreateObject("Schedule.Service")

error message is

Microsoft VBScript runtime error: ActiveX component can't create object: 'Scheduler.Service'

Now the same code works in a Vista machine. After googling I found out that an assembly called TaskScheduler.dll needs to be present in the machine for this code to work. I found this dll in the Vista machine (where its working) in the following location

C:\Windows\winsxs\msil_taskscheduler_31bf3856ad364e35_6.0.6001.18000_none_1 4fd1dd83f56d37e

But its absent in the 2003 machine. Does anybody know how you can get this dll? May be that will solve the problem. I found in one article that this dll comes from Microsoft Site Server 3.0. BTW, I tried putting the dll in the same location in the 2003 machine and registered it using regasm (regsvc was throwing error), although with a warning saying the tlb file was not registered. It still was not working.

EggHeadCafe - Software Developer Portal of Choice
New IEFT RFC indexed search page
http://www.eggheadcafe.com/tutorials/aspnet/aeff2e59-a780-4bfb-ae6d-b...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Oct 20 2009, 9:50 pm
Newsgroups: microsoft.public.scripting.vbscript
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Tue, 20 Oct 2009 23:50:37 +0200
Local: Tues, Oct 20 2009 9:50 pm
Subject: Re: 800A01AD error when creating Schedule.Service object

<munawar rashid> wrote in message

news:20091020164536a_m_rashid@hotmail.com...

Under OSs older than Vista you could use the code below. It uses schtask.exe
to obtain the details you're after.

'------------------------------------
'Display all selected scheduled tasks
'------------------------------------
Dim aTasks(100, 100), iTaskCount   'Array containing a list of all tasks
Set oWshShell = CreateObject("WScript.Shell")
Set oArgs = WScript.Arguments

AllTasks = (oArgs.Count = 0)
if not AllTasks then sTask = oArgs(0)
if sTask = "*" then AllTasks = True
If InStr(sTask, "?") > 0 Then Message "Usage: TaskLister [TaskName or *]
[Computer]"
if oArgs.count > 1 then sComputer = "/s """ & oArgs(1) & """" Else sComputer
= ""

Set oExec = oWshShell.Exec("schtasks.exe /query " & sComputer & " /v /fo
csv")
wscript.sleep 1000

oExec.StdOut.ReadLine 'Blank first line
ReadRecord aHeaders   'Read the headers record
ReadTasks
DisplayTasks

'--------------------------------------------
'Display full details of the selected task(s)
'--------------------------------------------
Sub DisplayTasks
   found = False
   For i = 0 To iTaskCount
      If AllTasks Or (UCase(aTasks(i, 1)) = UCase(sTask)) Then
         For j = 0 To UBound(aHeaders)
            Desc = aTasks(i, j)
            If Len(Desc) > 42 Then Desc = Left(Desc, 39) & "..."
            WScript.Echo Left(aHeaders(j) & Space(37), 37) & Desc
         Next
         found = True
         WScript.Echo
      End If
   Next
   if not found then Message ("Task """ & sTask & """ not found.")
End Sub
'---------------------------
'Put all tasks into an array
'---------------------------
Sub ReadTasks
   i = 0
   Do While Not oExec.StdOut.AtEndOfStream
      if i > 99 then Message "100 tasks processed - remaining taks (if any)
were ignored"
      ReadRecord aTemp
      For j = 0 To UBound(aTemp)
         aTasks(i, j) = aTemp(j)   'Copy the temp array into the tasks array
      Next
      i = i + 1
   Loop
   iTaskCount = i - 1
End Sub
'-----------------------------------------------
'Read one record from the output of schtasks.exe
'-----------------------------------------------
Sub ReadRecord(aRecord)
   aRecord = Split (oExec.StdOut.ReadLine, """,""")   'Split the CSV fields
   For i = 0 To UBound(aRecord)
      aRecord(i) = Replace(aRecord(i), """", "")      'Remove the remaining
quotes
   Next
End Sub
'-------------
'Error message
'-------------
Sub Message (sLine)
   WScript.Echo
   WScript.Echo sLine
   WScript.Quit
End Sub


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google