![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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_14fd1dd83f56d37e 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...exed-sear.aspx |
My System Specs![]() |
| | #2 (permalink) |
| | Re: 800A01AD error when creating Schedule.Service object <munawar rashid> wrote in message news:20091020164536a_m_rashid@newsgroup Quote: > 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_14fd1dd83f56d37e > > 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...exed-sear.aspx 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 |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Creating XPathDocument object in Powershell | PowerShell | |||
| Error 2 when creating an object | VB Script | |||
| Problem with ActiveX creating object on IE 7 in Vista | Vista General | |||
| Creating an array of floats using new-object | PowerShell | |||
| Creating a Schedule Task in Vista with schtasks, Getting Access De | Vista General | |||