Building a Batch Target Using the Command Line

If you have created a batch target in your project, you can build it using the command line.

How to Build a Batch Target Using the Command Line

  1. Open Notepad (to create and save a batch file) or open your command prompt (to run a command immediately).
  2. Type the path to the Flare.app folder where you installed Flare Desktop, and press ENTER.

    cd\Program Files\MadCap Software\MadCap Flare 21\Flare.app

    Note Alternatively, you can use cd c:\Program Files\[rest of the path] instead of cd\Program Files\[rest of the path].

  1. Type the following and press ENTER on your keyboard (entering the path to your project and the name of the target in place of the sections in angle brackets):

    Copy
    madbuild -project [project] -batch [batch target name]

    A log file is generated and saved automatically at the root level of the output folder for that target, whether or not there are errors or warnings. See Opening Build Logs.

    Note The default location for batch targets is in the root Targets folder in the Project Organizer. However, you can create subfolders and place different batch targets in different folders (see Creating Subfolders). If you do this, make sure you include the subfolder name in your command. You can do this by typing the name of the subfolder, followed by a slash, and then the name of the batch target (i.e., madbuild -project [project] -batch [mysubfoldername/mybatchtargetname]).

    Note If there are spaces anywhere in your path or project name, you need to use quotation marks around it.

    Example You have a project called "FictionsoftPro" that you have stored in a folder of the same name at the root level of the C: drive. If you want to build the batch target named "MyBatchTarget" in that project, you can type this:

    Copy
    madbuild -project c:\fictionsoftpro\fictionsoftpro.flprj -batch MyBatchTarget

    Example If the project is located in a folder called "my projects" (with a space), you would type this:

    Copy
    madbuild -project "c:\my projects\fictionsoftpro.flprj" -batch MyBatchTarget

    Example If the batch target is named "My Batch Target" (with spaces between words), you would type this:

    Copy
    madbuild -project "c:\my projects\fictionsoftpro.flprj" -batch "My Batch Target"

    If you are using the command prompt window, the targets in that project generate immediately, and the output files are copied to the Output subfolder in your main project folder.

    If you are creating a batch file in Notepad, it might look something like this: