/build/static/layout/Breadcrumb_cap_w.png

Vbscript to create a scheduled task

Has anyone created a VBscript to add a task to the scheduler or can anyone point me in the right direction?

0 Comments   [ + ] Show comments

Answers (2)

Posted by: UcMerrill 19 years ago
Senior Yellow Belt
0
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
Posted by: Naffcat 19 years ago
Senior Purple Belt
0
Many thanks
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ