Has anyone created a VBscript to add a task to the scheduler or can anyone point me in the right direction?
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


Here is an example: Schedules Notepad to run at 12:30 PM every Monday, Wednesday, and Friday.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set objNewJob = objWMIService.Get("Win32_ScheduledJob")

errJobCreated = objNewJob.Create _
("Notepad.exe", "********123000.000000-420", _
True , 1 OR 4 OR 16, , , JobID)
Wscript.Echo errJobCreated
Answered 03/31/2005 by: UcMerrill
Senior Yellow Belt

Please log in to comment
Many thanks
Answered 03/31/2005 by: Naffcat
Senior Purple Belt

Please log in to comment