HelpNDoc handles various command line parameters to be able to update and generate documentation without user interface. This is useful to integrate the documentation generation process with an automated build process for example.


Note: The command line syntax has changed in HelpNDoc 5.4 ans is not backward compatible. Check Legacy command line syntax for 5.3 and older to learn more about command line syntax in HelpNDoc 5.3 and earlier.


Command line syntax

The overall command line syntax is as follows:

hnd6.exe [project] [global-options] [command] [command-options]


Where:

Command line option

Explanation

hnd6.exe

HelpNDoc program

[project]

Path of the HND project file to open or build. Optional. See Project

[global-options]

Options available for every command. Optional. See Global Options

[command]

The command to perform. Optional. See Commands

[command-options]

Command specific options. Optional. See Commands


Project

Indicates the full or relative path of a *.HND project file.
When specified without any command, HelpNDoc's user interface is shown and opens with the specified project.
Note: Mandatory for the build command.


Global options

The following options are global: they can be useful for any commands:


Command line option

Explanation

-help or -h

Help on HelpNDoc: show a list of available commands and options

-log or -l

Indicates the log file path: any information displayed on the command prompt will also be saved to that file.
> hnd6.exe myproject.hnd -log=c:\tmp\log.txt build

-reset or -r

Reset HelpNDoc settings. When indicated, settings such as window positions, compiler location... won't be loaded from the registry. The new settings are saved to the registry when the application closes. This can be useful to troubleshoot potential settings problems.

> hnd6.exe -r

-silent or -s

Command line is in silent mode: it will automatically close without user interaction

-verbose or -v

Command line is verbose: it will display additional information if available

-verysilent or -ss

Command line is in very silent mode: it won't even open a command window


Commands

The following commands are available from the command line.

Note: Use the -help or -h after the command to get more information about that command.


Command line option

Explanation

build

Build the specified *.hnd project file using either the project's settings or overrides from the command line. See "build" command

license

Information and management of the license. See "license" command

script

Run a script using the HelpNDoc API to automate project creation or modification. See "script" command


"build" command

The build command is used to build a *.hnd project file from the command line, without showing HelpNDoc's user interface.

When run without any options, it will use the project settings to generate all enabled builds. It is possible to override some project settings with command options:


Command line option

Explanation

-except or -e

Generates all project builds except the specified ones. It is possible to use this command multiple times.

> hnd6.exe myproject.hnd build -e="Build HTML documentation" -e="Build CHM documentation"

-help or -h

Help on this command.

> hnd6.exe build -h

-only or -x

Generates only the specified build names. It is possible to use this command multiple times.

> hnd6.exe myproject.hnd build -x="Build PDF documentation" -x="Build Word documentation"

-output or -o

Override the output path for a specific build.

> hnd6.exe myproject.hnd build -o="Build HTML documentation:c:\www\index.html"

-statuses or -u

Override the statuses included for a specific build.

> hnd6.exe myproject.hnd build -u="Build HTML documentation:Complete,Needs Review"

-tags or -a

Override tags generated for a specific build.

> hnd6.exe myproject.hnd build -a="Build HTML documentation:clientA,clientB"

-template or -t

Override template used for a specific build.

> hnd6.exe myproject.hnd build -t="Build HTML documentation:Legacy HTML framed template"

-variable or -v

Override the value of a variable.

> hnd6.exe myproject.hnd build -v="Customer:clientB"


"license" command

The license command can be used to manage the license of the full version of HelpNDoc. Available options are:


Command line option

Explanation

-activate or -a

Activate a specific license key on this computer. Make sure the previous license key is deactivated first.

> hnd6.exe license -a="ABCDE-FGHIJ-KLMNO-PQRST-UVWXY"

Warning: This requires Internet access to the license servers. If you are behind a proxy, see how to set the proxy bellow.

-deactivate or -d

Deactivate a previously activated license on this computer. This makes it possible to move HelpNDoc's license key to another computer.

> hnd6.exe license -d
Warning: The number of allowed de-activations is limited to 5 to limit abuses. If you need more deactivations, please contact us with your license details.

-forcecheck or -f

If you've recently updated your license of HelpNDoc, it is possible that the license key is still not updated: using that command will connect to the license servers to retrieve the latest license details.

> hnd6.exe license -f

Warning: Make sure you are connected to the Internet to access the license servers.

-help or -h

Help on this command.

> hnd6.exe license -h

-info or -i

Provides information about the activation of HelpNDoc on this computer.

> hnd6.exe license -i

-proxy or -p

By default, the license checker will use the proxy set up in Internet Explorer. If you need to customize the proxy, you can indicate the proxy address so that the activation process is able to correctly connect to the license servers. Once done, the proxy address is saved and restored each time the application is launched.

Proxy must be in the form "http://username:password@host:port/". Note: if the port is not specified, it will default to 1080.

> hnd6.exe license -p="http://username:password@127.0.0.1:8080"


"script" command

The script command can be used to execute a custom script using the available HelpNDoc API methods to automate project creation or modification. Small scripts can be written in the command line, while large scripts can be loaded from a file.

Note: If a project is specified in the command line syntax, it will be opened first before executing the script, thus simplifying existing projects modification.


Command line option

Explanation

-file or -f

Load the script content from the file path specified.

> hnd6.exe script -f="c:\helpndoc\script.pas"

Note: If both the -f and -x command line options are defined, only the -x one will be used.

-help or -h

Help on this command.

> hnd6.exe script -h

-execute or -x

Run the script code provided directly on the command line.

> hnd6.exe script -x="ShowMessage('OK');"

Note: If both the -f and -x command line options are defined, only the -x one will be used.