
<section id='WC_BatchModeErrorHandling_id'
webfilename='batchmodeerrorhandling'>
    <title>
        Batch Mode Error Handling
    </title>
    <para>
        The following command-line options cause &app_name; to open, perform
        a task, and then shut down.
    </para>
    <unorderedlist style='compact'>
        &ApplicableCommandLineFlagsList;
    </unorderedlist>
    <para>
        These options are typically used when &app_name; is being run
        from a script or as a child process of another application. In
        this situation, &app_name; enters <termtext>batch mode</termtext>,
        which causes errors to be handled differently. Instead of an error
        message dialog box appearing, &app_name; writes the error message
        to a text file and then exits.
    </para>
    <para>
        If an error does not occur, &app_name; deletes the error message
        file if it exists. Therefore, after &app_name; exits, the calling
        script or application can determine if an error occurred by checking
        for the existence of this file. If the file exists, it will contains
        a description of the error that occurred.
    </para>
    <para>
        By default, the error message file is located in the &app_name;
        home directory (i.e., the same directory as <filetext>&app_name;.exe</filetext>),
        and is named <filetext>&app_name;BatchErrorFlagFile.txt</filetext>.
        If desired, you can specify another name using the <commandinput>-BatchErrorModeFlagFile</commandinput>
        command-line option. This option should be followed by the desired
        error message file name.
    </para>
    <note type='important'>
        <para>
            If your script or application will be simultaneously running multiple
            instances of &app_name;, it is strongly suggested that you
            use <commandinput>-BatchErrorModeFlagFile</commandinput> to specify
            a different error file for each instance.
        </para>
    </note>
    <para>
        In addition to the error file, &app_name; also uses a non-zero
        return code to indicate that an error occurred.
    </para>
</section>
