FireDaemon Pro Console Application (CLI)
Previous Topic  Next Topic 


The CLI allows you to control and manage FireDaemon Pro services via the command line. FireDaemon Pro does require elevation on Windows Vista, 2008, 7, 2008 R2, 8, 2012 or later so remember to open an elevated command prompt before attempting to use the CLI.



The Console Application takes a variety of command line options (some take both a short and long form). Note that every command line option returns an ERRORLEVEL of 0 or 1. The ERRORLEVEL determines whether the command was successful (0) or not (1) and can be evaluated in batch files. Rob Van der Woude's website has an excellent page dedicated to ERRORLEVELS.


Option

Description

-h

--help

Shows 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 <filename[.xml]>

--install <filename[.xml]> [edit]

Installs/reinstalls a service based on a fully validated XML configuration file. Syntax and validation errors are displayed on Stdout. The .xml file extension is optional. If edit is specified and the service already exists then the service is updated.

-u <Service>

--uninstall <Service>

Uninstalls a service using its Short Name or quoted Display Name. The service must be stopped first.

-v

--version

Display FireDaemon Pro executable and DLL version information.

-s

--service

Start FireDaemon Pro in service mode. This is only applicable when FireDaemon Pro is being controlled by the Service Control Manager.

-e

--export <Service> [<File.[xml]>]

Exports the service definition, as XML, named by <Service> to the file <File>. If <File> is not specified the configuration will be exported to stdout.

--export-all <Path\Filemask>

Export all FireDaemon Pro service definitions to separate files. A Filemask can be used to export via name and/or numerically. %SN% and ??? are replaceable parameters. Use %SN% as the Short Name and ??? for an incrementing numeric replacement. The quantity of ? will determine the value format (eg. ? = 0-9, ?? = 00-99, ??? = 000-999 and so forth). %SN% and ??? can be combined (eg. --export-all n:\some\path\%SN%???). .xml will appended to every file name.

--import-all <Path\Filemask>

Import FireDaemon Pro services definitions. Filemask can contain the standard DOS wildcards of * and ?.

--start <Service> [--in-session]

Starts the named Service. ServiceName may be Short Name or quoted Display Name of the service (eg. "Service Display Name"). Wildcards can also be used eg. --start ?ab*. If --in-session is supplied then the service will be started on the currently logged in session rather than session 0 (applicable to Windows Vista, 2008, 7, 8, 2012 or later only). Only services running as LocalSystem can be restarted in session.

--stop <Service>

Stops the named Service. ServiceName may be Short Name or quoted Display Name of the service. Wildcards can also be used eg. --stop ?ab*.

--restart <Service> [--in-session]

Stops then Starts the named Service. ServiceName may be Short Name or quoted Display Name of the service. Wildcards can also be used eg. --restart ?ab*. If --in-session is supplied then the service will be restarted on the currently logged in session rather than session 0 (applicable to Windows Vista, 2008, 7, 8, 2012 or later only).  Only services running as LocalSystem can be restarted in session.

--status <Service> [--pid]

Returns the status (Stopped/Running/Paused) of the named service. Wildcards can also be used eg. --status ?ab*. The --pid option will also display the process ID (PID) of the firedaemon.exe process (Service PID) as well as the PID of the application running under FireDaemon control (App PID).

--start-all

Starts all currently installed FireDaemon Pro services.

--stop-all

Stops all currently installs FireDaemon Pro services.

--restart-all

Stops then starts all currently installed FireDaemon Pro services.

--uninstall-all

Uninstalls all currently stopped FireDaemon Pro services.

--start-all-automatic

Starts all Automatic and Automatic (Delayed Start) FireDaemon Pro services that are currently stopped.

--kill-all

Brutally terminate all FireDaemon Services and their subprocesses with extreme prejudice in the least amount of time.

--create <Service> <File> <Path> <Params> [nochecks] [stopped] [replace][username=<username>] [password=<password>] [uponexit=0|1|2|3|4|5] [smffrequency=<value>]

Creates and starts an automatic service with minimal parameters. <Service> is the service Short Name, <File> is full path to executable, <Path> is the Working Directory and <Params> are optional arguments to be passed to the executable. You will need to quote up each argument if they contain spaces (eg. "C:\Program Files\SomeApp\App.exe"). If the Parameters need double quotes then they will have to be escaped with a backslash (eg. "-opt1=\"Some Opt\" -opt2=\"Some Other Opt\""). The nochecks option will cause FireDaemon Pro to not complete any validation of the executable or working directory. The stopped option will install the service but leave it in the stopped state. The replace option will overwrite any pre-existing service currently installed. username allows you to specify the user to run the service as. password allows you to specify the corresponding username's password. The uponexit value dictates what even occurs when the application terminates - see the XML definition for meanings. The smffrequency value determines how frequently the sub-process is monitored.

--clone-hot <Service>

Clones a pre-existing FireDaemon Pro service. When services are cloned hot, the Service Short Name and Service Display Name are modified. The Service Short Name is prepended with Clone-1-of-. The Service Display Name is prepended with Clone-1-of- and appended with the original Service Short Name in parenthesis. For example, a service called Test when cloned hot will have a new Service Short Name of Clone-1-of-Test and a new Service Display Name of Clone-1-of-Test (Test). After a service has been cloned hot, the Service Short Name cannot be modified via the GUI. You will need to export the service definition to XML, delete the original service, modify the XML definition, then re-import. The prepended string can be modified via the Options dialog.

--session0

Switch to session 0 allowing you to view interactive services running in isolation.

--register <Name> <Serial>

Registers FireDaemon Pro. <Name> is the Serial Number Name (ensure it is quoted if it contains spaces). <Serial> is the Serial Number. This information can be found on your Order Confirmation.

--configure <Path>

[OEM Only] Configures all necessary FireDaemon Pro/OEM registry entries required at runtime. This option is available only in the OEM version. Path refers to the fully quoted path to the location of all FireDaemon Pro/OEM executables and DLLs.

--deconfigure

[OEM Only] Removes all FireDaemon Pro/OEM registry entries. You need to ensure that all FireDaemon Pro/OEM services have been stopped and removed prior to using this option.