FireDaemon Pro provides a command-line interface (CLI) to control and manage FireDaemon Pro services.

Prerequisites

Before using the command-line interface to run any commands, please note the following:

  • FireDaemon Pro requires elevated privileges on Windows Vista, Windows Server 2008, or later. Therefore, you must open the command prompt with Administrator rights.

  • You should be familiar with the Windows command line escape characters before using the FireDaemon Pro CLI.

  • Any arguments that contain embedded whitespace characters must either be enclosed in double-quotes (for example, "C:\Some Path") or must have an escape character (\) added (for example, C:\Some\ Path).

Command Line Options

Certain command-line options have both short-form and long-form alternatives, for example -h or --help to display the command line help information.


Every command-line option returns an ERRORLEVEL of 0 or 1. The ERRORLEVEL determines whether the command was successful (0) or unsuccessful (1) and can be evaluated in batch files.



The following table runs through the functions of the available command line options.


OptionDescription

-v

--version

Displays the version details of the FireDaemon Pro program along with its DLL version.


For example, FireDaemon Pro (x64) 4.5.20-0-g46d759b8.

help

-?

-h

--help

Displays the command-line help options.  When used in conjunction with one of the other options (i.e. “firedaemoncli.exe help register”), it will show more information about what that option does. Always returns an ERRORLEVEL of 0. 
register <licensee> <key>Displays FireDaemon Pro registration information. Includes the required arguments of licensee and key:  register <licensee> <key>. Always returns an ERRORLEVEL of 0.
licenseDisplays the Registration Information dialog of FireDaemon Pro. The licensing can be changed from this screen manually. Always returns an ERRORLEVEL of 0.

install <file path> [options]


--update, --edit

--no-restart, --no-reload

Installs or edits a service according to a fully validated XML configuration file named <file path>. It is optional to specify the .XML extension when specifying the file name.


Syntax and validation errors are displayed on standard output (STDOUT).


The options are as follows:

  • [update] / [edit]: Edits attributes of an existing record or, if it doesn’t exist, creates the service.
  • [no-restart] / [no-reload]: Makes sure the changes will take affect only when the service is started or restarted.

If the startup mode for the service is set to Automatic or Automatic (Delayed Start), the service will be automatically started.


To allow reading a service definition from standard input (STDIN) in UTF-8 encoding, the file path should be specified as an empty string, e.g.


install "" [edit]

create <service name><file path> <directory path> <arguments> [options]


--tag

--startup-mode, --startup-type<0|1|2|3>

--run-like, sid-type=<0|1|3|5>

--account-name

--account-password

--upon-exit

--exclude-path-checks, --no-checks

--no-restart, --no-reload

--replace

Creates and automatically starts the service with minimal parameters.
  • <service name> is the short service name 
  • <file path> is the full path of the program to run as a service
  • <directory path> is the working directory
  • <arguments> are program arguments
  • [options] are optional parameters to be passed to the program.

Any argument that contains whitespace characters must be quoted. For example, "C:\Program Files\SomeApp\App.exe".


If any parameter requires double quotes, these must be escaped with a backslash (\) escape character, such as "-opt1=\"Some Opt\" -opt2=\"Some Other Opt\"".


The following additional parameters are also available:

  • [tag] sets the tag value for the service.
  • [startup-mode] / [startup-type] sets the start up type of the service. Valid values are 0-3, each representing a startup method. For more information, see XML Tags in Service Definition.  
  • [run-like] / [sidtype] specifies the Windows security identifier type of the service. Valid values are 0, 1, 3, and 5. For more information, see XML Tags in Service Definition.  
  • [account-name] specifies the user account under which the service runs. The format domain\username should be used.
  • [account password] specifies the password for the given user name.
  • [upon-exit] dictates what event occurs when the program terminates. Valid values are 0-7. For more information, see XML Tags in Service Definition.
  • [exclude-path-checks] / [no-checks] causes FireDaemon Pro to not perform any validation of the <file path> or <discovery path> parameters.
  • [no-restart] / [no-reload] installs the service but leaves it in the stopped state. Changes will take affect when the service is started or restarted.
  • [replace] overwrites any pre-existing service of the same name.
clone-hot <service>Clones the existing FireDaemon Pro service.


After cloning, the new service will have a Service Short Name that is prefixed with the string Clone-1-of-.


The Service Display Name is also prefixed with the string Clone-1-of-, and the original Service Short Name is added as a suffix in parenthesis.


The number in the prefix string is set as the lowest available number.


For example, cloning a service called Test will create a new service with a Service Short Name of Clone-1-of-Test and a Service Display Name of Clone-1-of-Test (Test).


Later you can modify the prefix string from the Global Options dialog.

edit <service1/service2/...>[options]


--exclude-path-checks

--no-restart, --no-reload

--tag

--startup-mode, --startup-type<0|1|2|3>

--run-like, sid-type=<0|1|3|5>

--program <file path>

--working-dir <directory path>

--parameters

--account-name

--account-password

--upon-exit <0|1|2|3|4|5|6|7>

--upon-flap <0|1|2|3>

--flap-count <n>

--upon-fail <0|1|2|3|4>

--fail-count <n>

--upon-hang <0|1|2>

--hang-period <mins>

--launch-delay <secs>

--schedule-clear

--schedule-name

--schedule-action %H:%M

--schedule-delete

Edits one or more specific attributes of one or more services.


If an invalid value is entered, an error will be returned.


A service can be edited regardless of its current state. However, the service must be restarted for the changes to take effect.


Any argument that contains whitespace characters must be quoted. For example, "C:\Program Files\SomeApp\App.exe"


If any parameter requires double quotes, these must be escaped with a backslash (\) escape character, for example "-opt1=\"Some Opt\" -opt2=\"Some Other Opt\"".


If any parameter requires double quotes, these must be escaped with a backslash (\) escape character, for example "-opt1=\"Some Opt\" -opt2=\"Some Other Opt\"".


The following optional parameters are available for edit:

  • [exclude-path-checks] / [no-checks] causes FireDaemon Pro to not perform any validation of the <file path> or <discovery path> parameters.
  • [no-restart] / [no-reload] installs the service but leaves it in the stopped state. Changes will take affect when the service is started or restarted.
  • [tag] sets the tag value for the service.
  • [startup-mode] / [startup-type] sets the start up type of the service. Valid values are 0-3, each representing a startup method. For more information, see XML Tags in Service Definition.
  • [run-like] / [sid-type] is the Windows security identifier type of the service. For more information, see XML Tags in Service Definition.
  • [program] is the full file path of the program to be run as a service.
  • [working-dir] is the working directory.
  • [parameters] are optional parameters to be passed to the program.
  • [account-name] is the user account under which the service runs. If this option is included,[account-password] is required.
  • [account-password] is the password for the given account name.
  • [upon-exit] dictates what event occurs when the program terminates. Valid values are 0-7. For more information, see XML Tags in Service Definition.
  • [upon-flap] is the action taken if the program fails during its start-up phase. Valid values are 0-3. For more information, see XML Tags in Service Definition.
  • [flap-count] is the number of flap restarts allowed before the [upon-flap] action is taken. 
  • [upon-fail] is the action taken if the program fails during its lifecycle. Valid values are 0-4. For more information, see XML Tags in Service Definition.
  • [flap-count] is the number of fail restarts allowed before the [upon-fail] action is taken. 
  • [upon-hang] is the action taken if the program freezes (hangs). Valid values are 0-2. For more information, see XML Tags in Service Definition.
  • [hang-period] sets the time in minutes FireDaemon Pro will wait before terminating a hung program.
  • [launch-delay] sets the time in seconds FireDaemon Pro will wait before launching the scheduled service.
  • [schedule-clear] clears (deletes) all of the service's schedule definitions
  • [schedule-name]is the name of the schedule to modify according to the following:
    • [schedule-action] sets a new restart time on the schedule.
    • [schedule-delete] deletes the named schedule.

import-all <directory path, file mask> [options]


--no restart, --no reload

Imports FireDaemon Pro services definitions using a wildcard.


You can use Filemask to import the service definitions. The Filemask can contain the standard DOS wildcards of * and ?.

Note: FireDaemon Pro does not check whether the set of service definitions is named uniquely.

If you add the optional [no-restart] or [no-reload], all imported services remain in the stopped state.

uninstall <service>Uninstalls a service using the Short Name specified when creating the service.


Note: Before uninstalling the service, you must first stop the service.

export <service spec> <path> [options]


--template

--matching

Exports the selected service definition(s) to an XML file.


The <service spec> can identify service(s) for export by name or by tag. Use the option [matching] to swap to exporting a tag. The default is svcname, so there is not need to use this option if using a service name.


The specified service(s) are exported to the <path>.


To export the template service definition, specify --template. To allow writing a service definition to standard output (STDOUT) in UTF-8 encoding, the file path should be specified as an empty string, e.g. export <service> "" --template.

export-all <directory path, file mask>Exports all FireDaemon Pro service definitions to separate files.


You can use Filemask to export the service definitions via name and/or numerically.


Use %SN% as the Short Name and ??? for an incrementing numeric replacement. %SN% and ??? are the replaceable parameters.


The number of ? characters will determine the value format. For example ? = 0-9, ?? = 00-99, ??? = 000-999 and so on.


You can combine %SN% and ???. For example: export-all n:\some\path\%SN%???.


Every file is automatically given the file extension .xml.

uninstall-allUninstalls all currently stopped FireDaemon Pro services.
list-tagsLists all tags.

list <service spec> [option]


--matching

Lists all installed FireDaemon Pro services. Always returns an ERRORLEVEL of 0.


The <service spec> is not required. Just list will return the full list of services. Currently, the only supported option for a shortened list is using a tag name.

list-allLists all installed FireDaemon Pro services.

status <service spec> [options]


--matching

--pid

Returns the current status of the specified service. The status can be Stopped, Running, or Paused.


The <service spec> can identify service(s) for export by name or by tag. Use the option [matching] to swap to exporting a tag. The default is svcname, so there is not need to use this option if using a service name.


You can also use wildcards. For example, --status ?ab*.


Specify [pid] to display the process ID (PID) of the firedaemon.exe process (Service PID) and the PID of the program running under FireDaemon control (App PID).

control <action> <service> [options]


--matching

--in-session

Controls a specified service(s). Includes the arguments action and service.


The available actions are:

  • start: starts the specified FireDaemon Service(s)
  • stop: stops the specified FireDaemon Service(s)
  • restart: restarts the specified FireDaemon Service(s).

The <service> can identify service(s) for export by name or by tag. Use the option [matching] to swap to exporting a tag. The default is svcname, so there is not need to use this option if using a service name.


The options are:

  • matching: One of svcname-wildcard, tag; defaults to svcname-wildcard
  • in-session:  Explicitly request to start or restart in the current user's session; if unspecified, a restart happens in the session of the user in which the program is running.
control-all <action>Controls all services. Includes the argument.


The available actions are:

  • start-all: starts all FireDaemon Pro Services
  • start-automatic: starts all Automatic and Automatic (Delayed Start) FireDaemon Pro Services that are currently stopped
  • stop-all: stops all FireDaemon Pro Services
  • restart-all: restarts all FireDaemon Pro Services
  • kill-all: immediately terminates all FireDaemon Pro Services and their programs.
session0 <action>

Switches the desktop to Windows session 0. The only action available is <switch>.


In session 0 you can view interactive services running in isolation.

-c

--configure

 --ProductName="<Name>"

 --ProductShortName="<Name>"

 --HelpFileName="<File>"

 --TurnOffSession0Switch[=yes]

 --TurnOffInSessionCommands[=yes]

 --TurnOffOnboardingCues[=yes]

[FireDaemon Pro OEM Only]

Configures all necessary FireDaemon Pro OEM registry entries and filesystem folders required at runtime along with the help file.


For more information, see the FireDaemon Pro OEM Installation and Configuration Guide.

-d

--deconfigure

[FireDaemon Pro OEM Only]

Removes all FireDaemon Pro OEM registry entries and empty filesystem folders.


Note: Before using this option, all FireDaemon Pro OEM services must be stopped and uninstalled.


For more information, see the FireDaemon Pro OEM Installation and Configuration Guide.