Hi ginnis24,
Under Windows XP there are two independent task schedulers. One is the AT.exe commandline scheduler which hails from NT4 days, and one is the scheduler most people are familiar with under Control Panel / Scheduled Tasks.
The AT.exe scheduler has a WMI clas that you can use. This is described here (
http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept04/hey0922.mspx) and it also explains a little of the differences between the two methods.
In XP, there is no way to properly script directly the Control Panel / Scheduled Tasks. In VISTA you can using the following:
Set objTaskService = CreateObject("Schedule.Ser
vice")
objTaskService.Connect
SO - the best way I have found is to shell out to use the XP commandline utility SCHTASKS.exe.
The command to create a task is fully exposed by opening a command prompt and typing 'SCHTASKS /Create /?'
e.g. one example may be as follows. This command will schedule the command C:\scripts\Hello.cmd to run as System account on computer SHARONPC1 to run on startup. The task will be called "Start up task - Hello":
SCHTASKS /Create /S SHARONPC1 /RU System /SC ONSTART /TN "Start up task - Hello" /TR "C:\scripts\Hello.cmd"
To execute that from vbScript you can adapt the lines below. Note that when shelling out you need to double up all double-quotes that are within the string.
Hope this helps,
Daz.