Release Automation

  • 1.  Windows Scheduled task - Import from XML file

    Posted Sep 11, 2017 04:10 PM

    Hi All,

     

    I am using TS - Create/Update Schedule Task  action to import the task from xml file and provided the all required paramter values but still getting the error message "Invalid syntax. Mandatory option 'sc' is missing. Type "CREATE /?" for usage"

     

    I am not able to trace where its exactly missing since /SC parameter i set  it to MONTHLY  value. Please find below snapshot for more details. I refered the WIKI page to see the required and optional parameter values.

     

    This action is executing correct to create the new task. 

     

    Please help me on this. 

     



  • 2.  Re: Windows Scheduled task - Import from XML file

    Broadcom Employee
    Posted Sep 11, 2017 10:17 PM

    Hi,

     

    Did you set /MO property in action settings?

    If no, please try following configuration.

     

    According to Windows Online Help of schtasks, if you use MONTHLY with /SC option, you need to set 1-12 or FIRST, SECOND, THIRD, FOURTH, LAST, LASTDAY to /MO option.

     

    I recommend to set "1" to [Modifier (/Mo)] if you want to run the task every month.

     

    Thanks

    Yas



  • 3.  Re: Windows Scheduled task - Import from XML file

    Broadcom Employee
    Posted Sep 12, 2017 01:03 AM

    Hi Dadabhau

        Yas solution works, Please find the screenshot for details.

     

     

    Regards,

    Piyush



  • 4.  Re: Windows Scheduled task - Import from XML file

    Posted Sep 12, 2017 09:37 AM

    Hi Piyush,

     

    I have tried with /MO option values as a 1 still getting same error message, However action status is Succeed. Would you please check Error Output

     

     



  • 5.  Re: Windows Scheduled task - Import from XML file

    Broadcom Employee
    Posted Sep 12, 2017 09:29 PM

    Hi Dadabhau

    Please check the values, I have put in.

    Only difference is  .XML file.

    Regards,

    Piyush



  • 6.  Re: Windows Scheduled task - Import from XML file
    Best Answer

    Broadcom Employee
    Posted Sep 12, 2017 11:01 PM

    Hi,

     

    I think /xml setting is conflicted with other properties. 

    If you exported task definition from Task Scheduler to XML file and attempt to import modified xml file using this action, I recommend to use "Run Command Line" action type instead of "TS - Create/Update Schedule Task".

    Sample of Command Line String:

    schtasks /Create /S <Hostname> /RU <Running User> /RP <Running Password> /TN <Task Name> /XML <XML file path>

     

    You can use other options of schtasks for your requirements. You can edit some elements like <CalendarTrigger> and <Exec> element in XML file as well.

     

    I think it is simple way to create task in Task Scheduler. 

    If you need further info of schtasks command, please check Microsoft Developer Network site.

    Schtasks.exe (Windows) 

     

    Cheers

    Yas



  • 7.  Re: Windows Scheduled task - Import from XML file

    Posted Sep 13, 2017 09:57 AM

    Hi Yas,

     

    Thanks for the input. let me try this and post the output here. 

     

    I addition i have one more query here " Check scheduled Task exists" or Delete Tasks actions are throwing below error message. are you aware about it, Task was not there on server but I do this error even if task is present on server.

     

    (#1) Error occurred during action execution: com/ca/nolio/rdk/dto/CLIAction

     



  • 8.  Re: Windows Scheduled task - Import from XML file

    Broadcom Employee
    Posted Sep 13, 2017 10:17 PM

    Hi,

     

    The action pack requires RDKCommon.jar. Please check if version of action pack is 10.2.1503.2 and RDKCommon-1.0.6.jar is existed under actionlib folder on target agent.

    For your reference:

    ftp://ftp.ca.com/pub/dpm/ReleaseAutomationActions/ActionPacks//nolio-windows-taskscheduler-actions/ActionPack.pdf

    Prerequisites to Run Microsoft Windows Task Scheduler Actions

    To run Microsoft Windows Task Scheduler actions, verify the following prerequisites:
    Extract and import the RDKcommon.jar file

     

    If you need the jar file, you can download from here.

    ftp://ftp.ca.com/pub/dpm/ReleaseAutomationActions/ActionPacks//nolio-windows-taskscheduler-actions/dependency.zip

     

    I think this action pack should work properly, but I'd like to recommend to use "Run Command Line" action type instead of Task Schedule Action Pack because of easy troubleshooting.

     

    Regards

    Yas



  • 9.  Re: Windows Scheduled task - Import from XML file

    Broadcom Employee
    Posted Sep 13, 2017 10:24 PM

    One more request.

    If you can accept our answer for original question on this thread, please mark Correct Answer. And, you need further help, please open new thread for additional questions. "1 question on 1 thread" helps us greatly.

     

    Thanks in advance.

    Yas