I am trying to create a task with very specific options:
This is how I create it from a CMD line:
schtasks /create /tn "Taskname" /tr "\"C:\Program Files\Program1\Program2\Start.exe\"/T" /sc daily /st 01:45:00 /ru "System"
It seems quite complicated to use Set objNewJob = objWMIService.Get("Win32_ScheduledJob") -
(for me anyway) so I was cheating and calling a CMD line but this doesn't work either.
I'm guessing its the " but can't figure it out...
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "cmd /c schtasks /create /tn "Taskname" /tr "\"C:\Program1\Program2\Start.exe\"/T" /sc daily /st 01:45:00 /ru "System""
Set objShell = NothingAny advice gratefully received.