Batch commands (flmprg)
Using the license manager batch feature allows you to run commands from a script file or in the batch console mode of the command.
Syntax
flmprg --batch [
help |
action=command [
parameters ]
[
^indent= [
on |
off ]
]
Where:
- command can be an action to display information, manage licenses, and view active users, etc.
- parameters can be one or more parameters and values separated by the caret
character (^). There is no space allowed before or after the
caret.
There are various parameters to manage licensing:^parameter=value
[
^...]
Note: Caret character (^)
flmprg uses the caret
character (^) for parsing.
flmprg --batch action=install-mkey^lnum=license_num^mkey=maintenance_key
In
Windows® the caret is also used to
escape special characters. To escape it, you may need to double (^^) it
up.flmprg --batch action=install-mkey^^lnum=license_num^^mkey=maintenance_key
Commands | Description |
---|---|
action=target-info |
Display information about the operating system, such as w64v141,
l64xl217,
etc.
|
action=product-info |
Display information about the product version. |
action=license-info |
Display license information. |
action=user-info |
Display active users information. |
action=lm-info |
Display information on the license manager configuration. |
action=up-info |
Check if a configured license manager is running and responding. |
action=env-info
|
Display environment / configuration information. |
action=host-info |
Display host information.
Optional parameters
are:
|
Commands | Description |
---|---|
action=install-license |
Install a license. Required parameters:
Examples:
|
action=uninstall-license |
Uninstall the license. The parameter lnum is a required with
the license number.
|
action=install-mkey |
Install a maintenance key or a subscription key. Required parameters:
|
action=install-ikey |
Install an installation key (Activate the license). Required parameters:
|
action=install-mkey-http |
Install a maintenance or subscription key using HTTP. Required
parameters:
Optional parameters:
|
action=install-ikey-http |
Install an installation key using HTTP (Activate the license). Required
parameters:
Optional parameters:
|
Commands | Description |
---|---|
action=decode-license-string |
Decode a license string. The parameter license-string is
required with the license string to decode. |
action=encode-license-string |
Encode a license string. Required parameters:
|
action=install-license-string |
Install a license in temporary mode using a license string. The parameter
license-string is required with the license string to install. |
action=install-license-string-http |
Install a license using a license string over HTTP. The parameter
license-string is required with the license string to install. |
Commands | Description |
---|---|
action=check-users |
Check active
users. Optional
parameters:
|
action=clear-sessions |
Clear all sessions.
Optional
parameters:
|
action=kill-session |
Kill session. Required parameter:
|
Usage
There are different ways of using batch commands, depending on your requirements.
- You can write batch commands to script files,
one command per line.
The script file can be executed directly to run the commands.flmprg --batch action=product-info
- You can write batch commands to a JSON file, one command per
line.
The JSON file can be piped into a command to run the flmprg in batch console mode.{"action":"product-info"}
flmprg --batch-console < myjsoncmds
- You can enter batch commands at the console of the flmprg running in batch
console mode (flmprg --batch-console). For example, at the batch console prompt,
enter the command to get information about
flmprg:
$ action=product-info
Running commands in Windows elevated command
In a Windows
system, some flmprg commands will only work if run as administrator, and a Microsoft® User Account Control (UAC)
prompt will be raised to open an elevated command terminal where you can complete the action.
If you have not started the command terminal with "Run as Administrator", the
following flmprg --batch commands will raise the UAC prompt:
action=install-license
action=uninstall-license
action=install-mkey
oraction=install-mkey-http
action=install-ikey
oraction=install-ikey-http
action=install-license-string
oraction=install-license-string-http
If you need to disable the UAC prompt, you can set the environment
variable FLM_BYPASS_UAC=1
. Be aware that with the UAC prompt disabled, you will need to
open a terminal with "Run as Administrator" to run commands that need
administrator privileges.
Formatting the output
The output from commands is JSON formatted. You can enable / disable indentation on the output. If the output is to standard out, the output is indented by default. If you are piping the output to a file or redirection (no terminal), the output indentation is disabled by default. You can combine an indentation instruction with any batch action.
action=product-info^indent=on
Output is
indented:{ "product": "flmprg", "version": "6.00.13", "wrtminver": "6.00.10", "build": "202301131121", "git-rev": "01e1199", "target": "w64v142", "status": 0, "status-msg": "Success." }