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.
Option | Description |
---|---|
-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. |
license | Displays 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:
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.
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:
|
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:
|
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-all | Uninstalls all currently stopped FireDaemon Pro services. |
list-tags | Lists 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-all | Lists 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:
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:
|
control-all <action> | Controls all services. Includes the argument. The available actions are:
|
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. |