# Schtasks with multiple actions

command linewindows task scheduler

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?

Note 1
Exporting and importing the xml is not something i want to do

• SchTasks does not allow you to define multiple Actions using the TR switch. To define multiple Actions, you need to define your task in an XML file, and then use the XML switch to import the settings.
From schtasks /create /?:
/XML  xmlfile      Creates a task from the task XML specified in a file.