locked
Batch script to launch the xml files from set of folder RRS feed

  • Question

  • I need to create a generic batch script to launch the batch  files from any folders and scheduling through windows task sheduler at predefined time.These batch xml files are from financial reporting studio and scheduleBatch.cmd is the inbuilt utility which calls these files(xmlfiles) when we run script. Below 1st batch script I have written for genric script(which launch a set of batch .xmlfilesfrom any folder and scheduling it through windows task scheduler at a predefined time to run particular folder)

    My 1st scipts is not working properly as expected. Am I missing something! please help me out on what lines to be added to make as expected.

    For the 1st script Let say there are n number of batch xml files that needs to be executed by the bat script and shedule these xml by windows task scheduler(daily monthly weekly) .How do i go about designing a script that will do the following:
    1. executing a list of n nuber of files to run from that folder.
    2. Do I need to pass any kind of parameters or set up any variables
    3. If the execution is successful the next file in the order is executed automatically and so on and goes to script\success.log file .If it is failed it should goes to script\Failed.log file
    how the error handling can be done to this script

    Do i put the above inside a function and pass the files as arguments or do i go with loops. Please help me out , i'd be extremely grateful. Thanks in advance

    1) SET xml_dir=%1

    SET hyp_server="server name"

    For %%z in (%xml_dir%\*.xml) do schedulebatch %%z %hyp_server%
    SET RC=%ERRORLEVEL%
    EXIT /B %R C%


    • Edited by 905ADI Friday, June 21, 2013 3:07 PM
    • Moved by Bill_Stewart Monday, August 19, 2013 5:06 PM Abandoned thread
    Thursday, June 20, 2013 2:51 PM

All replies

  • You would be much better off using PowerShell to do this.  It could be done in a couple of lines and would be easier to maintain.


    ¯\_(ツ)_/¯

    Thursday, June 20, 2013 3:52 PM
  • 1) SET xml_dir=%1

    SET hyp_server="server name"

    For %%z in (%xml_dir%\*.xml) do schedulebatch %%z %hyp_server%
    SET RC=%ERRORLEVEL%
    EXIT /B %R C%

    Right nw working on this genric script

    above 1st batch script I have written for genric script(which launch a set of batch .xmlfilesfrom any folder and scheduling it through windows task scheduler at a predefined time to run particular folder)

    My 1st scipts is not working properly as expected. Am I missing something! please help me out on what lines to be added to make as expected.

    For this 1st script Let say there are n number of batch xml files that needs to be executed by the bat script and shedule these xml by windows task scheduler(daily monthly weekly) .How do i go about designing a script that will do the following:
    1. executing a list of n nuber of files to run from that folder.
    2. Do I need to pass any kind of parameters or set up any variables
    3. If the execution is successful the next file in the order is executed automatically and so on and goes to script\success.log file .If it is failed it should goes to script\Failed.log file
    how the error handling can be done to this script

    Do i put the above inside a function and pass the files as arguments or do i go with loops. Please help me out , i'd be extremely grateful. Thanks in advance

    Thursday, June 20, 2013 3:55 PM