0

Hi,
I'm struggling to run a scheduled task on win7 machine (which is already created and calls a vbs) from XP machine programatically. I've tried this code for example:

dim objTaskService, objTask, objRootFolder

Set objTaskService = CreateObject("Schedule.Service")
objTaskService.Connect("win7pc")

Set objRootFolder = objTaskService.GetFolder("\")
Set objTask = objRootFolder.GetTask("test_task)
objTask.Run vbNull

This code works perfect when running it from win7-win7 or win7-XP machine but not XP-win7 machine.
It gives me "ActiveX component can't create object: 'Schedule.Service'" error but can't seem to find anything usefull to solve this error.

Does anyone has an idea why this code doesn't work in XP-win7 or can someone suggest another way how to run scheduled task programatically on windows7 machine when calling it from XP machine?

Tnx for suggestions,
regards

Edited by razree

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by john.knapp
0

Have you looked at schtasks.exe? There is a section of documentation here on MSDN that gives an overview of the requirements for running a task on a remote computer.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.