Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
schtasks and QM
#1
I'm trying to schedule a task using RunConsole2 to launch schtasks with a command line to create a scheduled task that will run a QM function.

The problem is getting it to create the right "TaskRun".

It needs to be=
"c:\program files\quick macros 2\qmcl.exe" T MS "{tr}""

But get return error:
ERROR: Invalid Argument/Option - 'T'.
Type "SCHTASKS /CREATE /?" for usage.


Function ScheduleOnce
Code:
Copy      Help
function int'mm str'tn str'tr

;EXAMPLE
;ScheduleOnce 1 "Test" "Function3"

;;Adds number of minutes from now to schedule task
DATE d.getclock
d=d+(6.9444444444444444444444444444444e-4*mm)

;;Deletes old task if couldn't run.
;;Create task will fail if task with same name exists
str Del=
F
;schtasks
;/Delete
;/TN {tn}
;/F
Del.findreplace("[]" " ")
Del.trim
RunConsole2(Del str'out1)
out out1

;;Defines time to run for command line formatting
str st.timeformat("{HH}:{mm}:{ss}" d)
str sd.timeformat("{MM}/{dd}/{yyyy}" d)

;;Formats schtasks command line
str cl=
F
;schtasks
;/create
;/tn {tn}
;/tr "c:\program files\quick macros 2\qmcl.exe" T MS "{tr}""
;/sc once
;/st {st}
;/sd {sd}
cl.findreplace("[]" " ")
cl.trim

RunConsole2(cl str'sout)
out sout


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)