I am trying to create a schedule task using command line which has multiple actions running more than one batch files in sequence among other things
SCHTASKS /Create /TN TaskName /SC ONLOGON /TR C:\ost\sanAuto.bat /TR C:\ost\ClEvtLog.cmd
What I have tried that didn't work:
SCHTASKS /Create /TN tsk /SC ONLOGON /TR "C:\sanAuto.bat","C:\ClEvtLog.cmd"
this one create single action to run a program as "C:\sanAuto.bat","C:\ClEvtLog.cmd"
SCHTASKS /Create /TN tsk /SC ONLOGON /TR "C:\sanAuto.bat" /TN "C:\ClEvtLog.cmd"
This one says multiple /TN not allowed
Is there a way to create tasks from command line and specify multiple actions?
Exporting and importing the xml is not something i want to do