FireDaemon Pro provides a command-line interface (CLI) called FireDaemonCLI to control and manage FireDaemon Pro services. FireDaemonCLI is installed into the FireDaemon Pro installation directory by default (e.g. C:\Program Files\FireDaemon Pro\FireDaemonCLI.exe). 


Prerequisites

Before using FireDaemonCLI to run any commands, please note:

  • FireDaemonCLI works in two modes: Privileged and Unprivileged. Privileged mode gives you access to all FireDaemonCLI subcommands. Unprivileged mode gives you access to a subset of FireDaemonCLI subcommands. Privileged mode commands are only available when FireDaemonCLI is run in an elevated Command Prompt or PowerShell Console (i.e. launched with "Run as administrator").

  • You should be familiar with the Windows command line escape characters before using FireDaemonCLI.

  • Any arguments that contain whitespace characters must be enclosed in single or double-quotes (e.g. "C:\Some Path").

Return Codes

Every FireDaemonCLI subcommand returns a numeric value indicating success or failure. At a Command Prompt this is referred to as ERRORLEVEL. At a PowerShell Console this is referred to as LASTEXITCODE. An ERRORLEVEL/LASTEXITCODE of 0 indicates the subcommand completed successfully. A value of 1 indicates the subcommand did not complete successfully. The return numeric value as follows:


At a Command Prompt:


@ECHO OFF

FIREDAEMONCLI <subcommand>

IF %ERRORLEVEL% == 0 (

    ECHO "Worked"

) ELSE (

    ECHO "Failed"

)


At a PowerShell Console:


.\FireDaemonCLI <subcommand>
if ($LASTEXITCODE -eq 0) {

    Write-Host "Worked"

} else {

    Write-Host "Failed"

}


Abridged FireDaemonCLI help is available for subcommands in the form FireDaemonCLI help or FireDaemon help <subcommand>.


Redirecting Output

Most FireDaemonCLI subcommands generate text output. This output might be informational or warning messages; or the output from the command itself. This may not be ideal when using the FireDaemonCLI subcommands in scripts. You can suppress text output using the redirection.


For example, at a Command Prompt:

@ECHO OFF
FireDaemonCLI <subcommand> 2>NUL 2>&1


For example, at a PowerShell Console:


[void](.\FireDaemonCLI <subcommand>) 


Quoting and Escaping Whitespace

Any argument that contains whitespace characters must be quoted. For example, if when specifying a file name ensure the string is quoted as follows:

"C:\Program Files\Program Name\My Program.exe"


If any argument requires double quotes, these must be escaped with a backslash (\) in Command Prompt and backtick (`) in PowerShell Console.


Command Prompt example:


"-opt1=\"Some Opt\" -opt2=\"Some Other Opt\""


PowerShell Console example:


"-opt1=`"Some Opt`" -opt2=`"Some Other Opt`""


Options and Subcommands

Some FireDaemonCLI Options have both short-form and long-form alternatives. (e.g. -h or --help). Some FireDaemonCLI Subcommands have equivalent options. This is for backward compatibility.


FireDaemon Pro FireDaemonCLI Options and Subcommands


The following table details the available FireDaemonCLI Options and Subcommands.


Option/SubcommandDescription

-v

--version

Displays the version details of the FireDaemon Pro program along with its Git commit hash. For example:


FireDaemon Pro (x64) 6.3.0-0-g959ef0aba

help

-?

-h

--help

Displays the command-line help options.  When used in conjunction with one of the other subcommands (e.g. FireDaemonCLI help register), it will show more information about what that option does. Always returns 0. 
register "<licensee>" <key>Registers FireDaemon Pro. Ensure you include both the required arguments of licensee and key which correlate to Serial Number Name and Serial Number on your FireDaemon Pro order confirmation email. If the licensee contains spaces, ensure you contain the licensee in double quotes. Always returns 0.
licenseDisplays the FireDaemon Pro Registration Information dialog containing the Serial Number Name and serial number. You can enter or update the license information via this dialog. Always returns an 0.
install <file spec> [options]

Options:

--no-restart, --no-reload 
--update, --edit
Installs or edits a service according to a fully validated XML configuration file named <file spec>. It is optional to specify the .xml extension when specifying the file name. Syntax and validation errors are displayed on standard output (stdout).


[options] are as follows:

  • --no-restart or --no-reload: Does not start or restart the service. If the services has been edited, changes will be in a pending state and the service will need to be restarted manually later
  • --update or --edit: Updates/edits attributes of an existing service. If the service does not it exist, the service is created.


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


To install a a service definition from standard input (stdin) in UTF-8 encoding, the <file spec> should be specified as an empty string. For example:


FireDaemonCLI install "" < servicedef.xml

create <service> "<file spec>" "<directory path>" "<parameters>" [options]

Options:


--tag <tag>
--startup-mode,
--startup-type <0|1|2|3>
--run-like,
--sid-type <0|1|3|5>
--account-name <name>
--account-password <password>
--upon-exit <0|1|2|3|4|5|6|7>
--exclude-path-checks,
--no-checks
--no-restart, --no-reload
--replace

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


[options] are as follows:

  • --tag sets the tag of the service
  • --startup-mode or --startup-type sets the start up type of the service. Valid values are 0,1,2,3 where 0 = Automatic (Delayed Start), 1 = Automatic, 2 = Manual, 3 = Disabled. See the Program Tab for more information on Startup Types
  • --run-like or --sid-type specifies the Windows Run Permissions (Security Identifier Type) of the service. Valid values are 0, 1, 3, 5 where 0 Default Service User, 1 = Unrestricted Service Service User, 3 = Restricted Service User, 5 = Windows Standard User. See the Settings Tab for more information on Run Permissions
  • --account-name specifies the user account under which the service runs. The format of the account name must comply with standard Windows and domain user naming patterns. See the Settings Tab for more information on Logon Accounts and Passwords
  • --account-password specifies the password for the given user account name. The account password can be omitted for sMSA, gMSA, dMSA, and vSA accounts. See the Settings Tab for more information on Logon Accounts and Passwords
  • --upon-exit determines what should occur if the program exits. Valid values are 0 through 7 and correlate to the values found in the Lifecycle Tab, Upon Program Exit field
  • --exclude-path-checks or --no-checks causes FireDaemon Pro to not perform any validation of the <file path> or <directory path> arguments
  • --no-restart or --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 existing existing service of the same name.
clone-hot <service>Clones an existing FireDaemon Pro service where the Service Name is <service>, installs, and starts it based on the existing service's Startup Type.


After cloning, the new service will have a Service Name and Display Name prefixed with the string Clone-n-of- and the original Service Short Name is added as a suffix in parenthesis.


The number (n) 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 Name of Clone-1-of-Test and Name of Clone-1-of-Test (Test).


Later you can modify the prefix and separator from the Global Options dialog.

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

Options:


--exclude-path-checks

--no-restart, --no-reload

--tag <tag>

--startup-mode,

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

--run-like,

--sid-type <0|1|3|5>

--program "<file spec>"

--working-dir "<directory path>"

--parameters "<parameters>"

--account-name <name>

--account-password <password>

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

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

--flap-count <number>

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

--fail-count <number>

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

--hang-period <minutes>

--launch-delay <seconds>

--schedule-clear

--schedule-name

  --schedule-action %H:%M

  --schedule-delete

Edits one or more specific attributes of one or more services. A service can be edited regardless of its current state. However, the service must be restarted for the changes to take effect.


[options] are as follows:

  • --exclude-path-checks causes FireDaemon Pro to not perform any validation of the <file spec> or <directory path> arguments
  • --no-restart or --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 or --startup-type sets the start up type of the service. Valid values are 0,1,2,3 where 0 = Automatic (Delayed Start), 1 = Automatic, 2 = Manual, 3 = Disabled. See the Program Tab for more information on Startup Types
  • --run-like or --sid-type specifies the Windows Run Permissions (Security Identifier Type) of the service. Valid values are 0, 1, 3, 5 where 0 Default Service User, 1 = Unrestricted Service Service User, 3 = Restricted Service User, 5 = Windows Standard User. See the Settings Tab for more information on Run Permissions
  • --program is the full path, name, and extension of the program to be run as a service
  • --working-dir is the full path of working directory of the program to be run as a service
  • --parameters are the parameters to be passed to the program to be run as a service
  • --account-name specifies the user account under which the service runs. The format of the account name must comply with standard Windows and domain user naming patterns. See the Settings Tab for more information on Logon Accounts and Passwords
  • --account-password specifies the password for the given user account name. The account password can be omitted for sMSA, gMSA, dMSA, and vSA accounts. See the Settings Tab for more information on Logon Accounts and Passwords
  • --upon-exit determines what should occur if the program exits. Valid values are 0 through 7 and correlate to the values found in the Lifecycle Tab, Upon Program Exit field
  • --upon-flap is the action taken if the program fails during its start-up phase. Valid values are 0 through 4 and correlate to the values found in the Lifecycle Tab, Flap Detection field
  • --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 through 4 and correlate to the values found in the Lifecycle Tab, Fail Detection field
  • --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 through 2 and correlate to the values found in the Lifecycle Tab, Hang Detection field
  • --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 a 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 schedule.

import-all "<file mask>" [options]


Options:


--no-restart, --no-reload

Imports FireDaemon Pro service definition XML files using a wildcard.


<file mask> represents the full path and wildcard to the XML files you wish to import. The file mask can contain special characters including * (any characters) and ? (any character). For example:

"C:\XML Files\FireDaemon*-??1.xml"

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

If you add the option --no-restart or --no-reload, all imported services remain in the stopped state irrespective of their startup type.

uninstall <service>Uninstalls a service using the service's short name specified when creating the service.
Note: Before uninstalling a service, you must first stop the service.
uninstall-allStops and uninstalls all FireDaemon Pro services. Use this subcommand with care as there is no prompt to confirm the uninstallation of all services.

export "<service spec>" "<directory path>" [options]


Options:


--template

--matching <svcname|tag>

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


The <service spec> can identify service(s) for export by service name or by tag. Use the option --matching to export services that have a specific tag assigned. The default is svcname.


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


To export the template service definition, specify --template. To allow writing a service definition to stdoud in UTF-8 encoding, the file path should be specified as an empty string. For example:


FireDaemonCLI export "My Service" "" --matching svcname

export-all <file spec>Exports all FireDaemon Pro service definitions to separate files. Every file is automatically given the file extension: .xml.


Use <file spec> to export the service definitions via name and/or numerically.


Use %SN% as the service 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 etc.


You can combine %SN% and ???. For example:


FireDaemon Cli export-all "C:\FD Configs\%SN%???"

list-tagsLists all tags.

list [<service spec>] [options]


Options:


--matching tag

Lists all installed FireDaemon Pro services. Always returns 0.


If <service spec> is not supplied, all services will be listed. Use --matching tag to list services with a specific tag applied.

list-allLists all installed FireDaemon Pro services.
show-sd <service> [options]

Options:


--aspect <dacl|sacl>
--format <listing|table|table-with-legend|sddl-string>
Displays a service's Security Descriptor (SD).

Use --aspect dacl to display the Owner and Discretionary Access Control List (DACL). Use --aspect sacl to display the Owner and System Access Control List (SACL).

Use --formatto determine the output format:
  • listing displays the Owner, DACL or SACL as a list
  • table displays the Owner DACL or SACL in tabular format
  • table-with-legend is the same as table but includes an SSDL Right and Right Value legend
  • sddl-string displays the Owner, DACL or SACL as a SDDL string.
reset-sd <service>Resets a service's DACL to the system default.

status <service spec> [options]


Options:


--matching <svcname-wildcard|tag>

--pid

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


<service spec> is used to list the status of services by name or by tag. Use the option --matching to list service status by service name pattern or tag.


For example:


FireDaemonCLI status GameServer --matching tag

FireDaemonCLI status M??e* --matching svcname-wildcard


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 (A Program PID).

control <action> <service spec> [options]


Options:


--matching <svcname-wildcard|tag>

--in-session

Controls individual services.


<action> are:

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


<service spec> is used to list the status of services by name or by tag. Use the option --matching to list service status by service name pattern or tag.


--in-session is used to request to start or restart the service in the current user's session.

control-all <action>Controls all services.


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.