How can I enter a caption for a scheduled task. I have used the following code from MS Script repository but it creates a caption of AT1 then AT2 etc if it already exists.
I want a description that refects the task.
Here is the code:
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
I want a description that refects the task.
Here is the code:
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