Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Batch file to run processes asynchronously

  • 31-03-2011 9:04am
    #1
    Registered Users, Registered Users 2 Posts: 7,541 ✭✭✭


    Morning all,

    My experience of writing batch scripts is limited to .bat files calling one or two processes synchronously. So looking to get some advice on something more complex.

    Environment is Windows Server 2008 and it has Powershell 2 installed if that's needed.

    What I'm looking to do is to create a batch file that can be called in a scheduled task.

    This batch file will in turn call several other batch files that must all run asynchronously (i.e. in parallel). These asynch batchfiles will contain a process that will extract data from an datasource into a .csv file and then sftp that .csv to a remote server. I'd like to log the output from each of these asynch batch files(i.e. success/error messages) to a text file. The main batch should also log its output to a text file.

    So I'm guessing I chould do something like:
    Main.bat:
    start async1.bat >> c:\some dir\output1.log
    start async2.bat >> c:\some dir\output2.log
    etc
    

    Is it as simple as that?? Or am I missing somthing?

    Also if I wanted some logic that will determine if the async batches ran correctly how do I do that? Analyse the output for key words (i.e. Error! Failure, etc) and act appropriately?

    Any advice welcome! Thanks


Advertisement