You are here: Working with Projects > Building the Current Help Target > Building Help Targets in Batch Mode

Building Help Targets in Batch Mode

You may also choose to build a Help target in batch mode using a command line through a special executable program, C1D2HBatch.exe, installed with Doc-To-Help. The file is located in C:\Program Files\ComponentOne\DocToHelp, by default.

The commands that can be used correspond with the commands in the Build menu of the Doc-To-Help project editor and include:

Command

Description

Example

c1d2hbatch –build project target flags

Rebuilds the current Help target entirely.

c1d2hbatch -build "c:\D2H Projects\StyleGuide\StyleGuide.d2h" "StyleGuide NetHelp" -p

c1d2hbatch – make project target flags

Updates the current Help target.

c1d2hbatch -make "c:\D2H Projects\StyleGuide\StyleGuide.d2h" "StyleGuide Manual"

c1d2hbatch –compileall project target flags

Compiles all project files.

c1d2hbatch -compileall "c:\D2H Projects\StyleGuide\StyleGuide.d2h" "StyleGuide NetHelp"

c1d2hbatch –compile project target document_name flags

Compiles the specified document.

c1d2hbatch -compile "c:\D2H Projects\StyleGuide\StyleGuide.d2h" "StyleGuide HTML Help" -p

Note: There is currently only one flag allowed in 'flags': -p, enabling the output of progress messages.

All error and log messages are output to the console standard output and have the following format:

      For errors aborting compilation:

    D2H:fatal error:<error code>: <message text>

The <error code> is a numeric error code.

      For logged user errors, compilation continues and every log error is output as three lines in the order as shown in the following example. The three lines correspond to the three columns shown in the Errors list in the project editor:

    D2H:log error document:<document name>
    D2H:log error topic:<topic title>
    D2H:log error message:<severity>:<message text>

The <document name> and <topic title> can be empty, depending on the nature of the error.

The <severity> will be listed as one of the following three strings: "note", "warning", or "error".

      A log message, for information only, shows what document is currently compiling, what action is being performed, and so on:

    D2H:log:<message text>

      A progress message appears only if the -p flag is present:

    D2H:progress:<done>/<total>

Here <done> is an integer number indicating how many steps of the currently performed action have been completed so far.

The <total> is an integer number indicating the total number of steps in the currently performed action.

      A progress completion message indicates that the current action has been completed, and it appears only if the -p flag is present:

    D2H:progress:done

      An unresolved links list is the output at the end of a successful build when the -build or -make commands are used. Every unresolved link is output as four lines in the order as shown in the following example. The four lines correspond to the four columns shown in the Unresolved Links list in the project editor:

    D2H:unresolved link text:<link text>
    D2H:unresolved link style:<style name>
    D2H:unresolved link topic:<topic title>
    D2H:unresolved link document:<document name>

      For a successful build:

    D2H:succeeded

      For a failed build:

    D2H:failed

      The last message before Doc-To-Help batch mode exits:

    D2H:exit

Note: In Windows Vista, C1D2HBatch.exe must be run "as administrator", otherwise it will always throw an exception. If you run it directly, start it with "Run as Administrator", available in Windows Vista in the context menu of the C1D2HBatch.exe file. If you run it from command line prompt, open the comand line window with "Run as Administrator". If you run it from a script or a program, make sure the script or program runs as administrator.