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


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).


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.


FireDaemon Pro Command Line CLI



OptionDescription
-h
--help
Displays the command-line help options.
Always returns an ERRORLEVEL of 1.
-r
--registration
Displays FireDaemon Pro registration information.
Always returns an ERRORLEVEL of 0.
-l
--list
Enumerates and lists all installed FireDaemon Pro services.
Always returns an ERRORLEVEL of 0.
-i <File> [edit] [stopped]
--install <File> [edit] [stopped] [no-apply]
Installs or reinstalls a service according to a fully validated XML configuration file named <File>. It is optional to specify the .XML extension when specifying the file name.

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

If you specify edit when the service already exists, the service is updated. Otherwise, the service is replaced completely.

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

The following additional parameters are also available:
  • [stopped] installs the service but does not start it, regardless of its startup mode setting.
  • [no-apply] installs (or updates) the service, but does not immediately apply the changes. The service must be separately started or restarted.

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]
-u <Service>
--uninstall <Service>
Uninstalls a service using the Short Name or the Display Name specified when creating the service.

Note: Before uninstalling the service, you must first stop the service.
-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
-s
--service
Starts FireDaemon Pro in service mode.

This option is applicable only when the Service Control Manager is controlling FireDaemon Pro.
-e
--export <Service> <File> [template]
Exports the service definition to an XML file.

The service named as <Service> is exported to the file name <File>. If <File> is not specified, the configuration will be exported to standard output (STDOUT).

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> ""
--export-all <Path\Filemask>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
--import-all <Path\Filemask> [stopped]Imports FireDaemon Pro services definitions.

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 specify stopped, all imported services remain in the stopped state.
--start <Service> [--in-session]Starts the named service.

The <Service> can be a Short Name or a quoted Display Name given to the service when creating it. For example, "Service Display Name".

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

If you specify --in-session, the service will be started in the currently logged in the session instead of Windows session 0, which applies only to Windows Vista, 2008, 7, 8, 2012 or later.

Note: You can restart only the services running as LocalSystem.
--stop <Service>Stops the named service.

The <Service> can be a Short Name or a quoted Display Name given to the service when creating it. You can use wildcards, for example --stop ?ab*.
--restart <Service> [--in-session]Stops and then starts the named service.

The <Service> can be a Short Name or a quoted Display Name given to the service when creating it.

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

If you specify --in-session, the service will be restarted in the currently logged in session instead of Windows session 0, which applies only to Windows Vista, 2008, 7, 8, 2012, or later.

Note: You can restart only the services running as LocalSystem.
--status <Service> [--pid]Returns the current status of the named service. The status can be Stopped, Running, or Paused.

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).
--start-allStarts all currently installed FireDaemon Pro services.
--stop-allStops all currently installed FireDaemon Pro services.
--restart-allStops and then starts all currently installed FireDaemon Pro services.
--uninstall-allUninstalls all currently stopped FireDaemon Pro services.
--start-all-automaticStarts all Automatic and Automatic (Delayed Start) FireDaemon Pro services that are currently stopped.
--kill-allImmediately terminates all FireDaemon Pro Services and their programs with extreme prejudice.
--create <Service> <File> <Path> <Params> [nochecks] [stopped] [replace] [sidtype=<0|1|3>] [username=<username> password=<password>] [uponexit=0|1|2|3|4|5|6|7] [smffrequency=<msecs>]Creates and automatically starts the service with minimal parameters.
  • <Service> is the Short service name 
  • <File> is the full path of the program to run as a service
  • <Path> is the working directory
  • <Params> 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, for example
"-opt1=\"Some Opt\" -opt2=\"Some Other Opt\""

The following additional parameters are also available:
  • [nochecks] causes FireDaemon Pro to not perform any validation of the <File> or <Path> parameters
  • [stopped] installs the service but leaves it in the stopped state.
  • [replace] overwrites any pre-existing service of the same name.
  • [sidtype] specifies the Windows security identifier type of the service. For more information, see XML Tags in Service Definition.  
  • [username] specifies the user account under which the service runs. The format domain\username should be used.
  • [password] specifies the password for the given user name.
  • [uponexit] dictates what event occurs when the program terminates. For more information, see XML Tags in Service Definition.
  • [smffrequency] determines how frequently the program is monitored in milliseconds. To disable monitoring updates, set the frequency to zero.
--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 Options dialog.
--edit [--validate] <Service>
 --SidType=<0|1|3>
 --Program="<File>"
 --WorkingDir="<Path>"
 --Parameters="<Params>"
 --UponProgramExit=<0|1|2|3|4|5|6|7>
 --UponProgramFlap=<0|1|2|3>
 --ProgramFlapCount=<n>
 --UponProgramHang=<0|1|2>
 --ProgramHangMinutes=<mins>
 --NoApply
 --LaunchDelaySeconds=<secs>
 --ScheduleClear
 --ScheduleName="<Name>"
   --ScheduleRestart=%H:%M
   --ScheduleDelete
 --AccountName="<domain>\<user>"
 --AccountPassword="<password>"
Edits one or more specific attributes of the service named <Service>.

Any combination of one or more attributes may be edited.

No checks are made on the validity of the options, unless --validate is specified. The changes are immediately reflected in the registry.

A service can be edited regardless of its current state.
However, unless --HotReload or --ScheduleHotReload is specified, 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\""

Note: --validate validates the entire service configuration and not just the modified values.

The following additional parameters are also available:
  • --SidType is the Windows security identifier type of the service. For more information, see XML Tags in Service Definition
  • --Program is the full path of the program to be run as a service
  • --WorkingDir is the working directory
  • --Parameters are optional parameters to be passed to the program
  • --UponProgramExit is the action taken if the program exits. For more information, see XML Tags in Service Definition.
  • --UponProgramFlap is the action taken if the program fails during its start-up phase. For more information, see XML Tags in Service Definition.
  • --ProgramFlapCount is the number of flap restarts allowed before the flap action is taken. 
  • --UponProgramHang is the action taken if the program freezes (hangs). For more information, see XML Tags in Service Definition.
  • --ProgramHangMinutes is the time FireDaemon Pro will wait before terminating a hung program.
  • --NoApply the edit changes are saved, but not immediately applied. The changes take effect at the next restart.
  • --LaunchDelaySeconds is the time FireDaemon Pro will wait before launching the scheduled service.
  • --ScheduleClear clear (delete) all of the service's schedule definitions.
  • --ScheduleName is the name of the schedule to modify according to the following:
    • --ScheduleRestart set a new restart time on the schedule
    • --ScheduleDelete delete the named schedule
  • --AccountName is the user account under which the service runs. The format domain\username should be used.
  • --AccountPassword is the password for the given account name.
--session0Switches the desktop to Windows session 0

In session 0 you can view interactive services running in isolation.
--register "<Name>" <Serial>Registers FireDaemon Pro.
  • <Name> is the Serial Number Name. Ensure that you include the name in the quotes if the name contains spaces.
  • <Serial> is the Serial Number. This can be found in the order confirmation email that you receive after purchasing the FireDaemon Pro license.
-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.