This command-line executable provides an easy way to execute the templates of the SendCommand function from different environments
SendCommand function allows operations to be performed, using a standard template in XML and JSON format, synchronously or asynchronously.
For example, lksendcommand can be used from a Windows .bat file or from a BASIC Program, to access data from a remote MV database.
On Windows the syntax is: lksendcommand.exe [options]
On Linux and macOS the syntax is ./lksendcommand [options]
Argument |
Required |
Descriptión |
Example |
/? |
Shows help
|
/? |
|
/H |
* |
IP address or hostname where Linkar SERVER is located |
/H:127.0.0.1 |
/P |
* |
EntryPoint port number
|
/P:11200 |
/E |
* |
EntryPoint name
|
/E:E1 |
/U |
* |
Linkar SERVER username
|
/U:admin |
/W |
* |
Linkar SERVER user password
|
/W:admin |
/L |
language that is sent to the database
|
/L:ES |
|
/T |
free text sent with the commands
|
/T:LkSendCommand |
|
/F |
File path where the file you want to execute is located |
/F:C:\temp\Read.xml |
|
/S |
text of the directly specified command in the console |
/S:command. |
|
/O |
File Path with the command result, in case of not specified the result will appear in the console |
/O:C:\temp\ReadResponse.xml |
|
/M |
message format (XML or JSON) |
/M:XML |
|
/C |
CodePage, characters set used for the text codification |
/C:1252 |
|
/R |
Remove the labels that evolve the command in the result of the operation |
/R |
|
/B |
When MV output format is selected, Linkar sends data encoded in Base64. A new /B option has been added that will decode Base64 before creating the MV buffer
|
/B |
In the demo /lksendcommand folder there are script examples and command files that execute them so you can try some Linkar functions.
In Windows, see script demo_lksendcommand.cmd, which must be modified with local credentials before execution.
@ECHO OFF
SET host=127.0.0.1
SET entrypoint=E1
SET epport=11500
SET user=admin
SET pass=admin
SET freetext="From lksendcommand"
SET encoding=""
lksendcommand.exe /F:XML/New-None.xml /U:%user% /W:%pass% /H:%host% /P:%epport% /E:%entrypoint% /T:%freetext% /O:NewResponse.xml /M:XML /C:%encoding% /R
...
In Linux and macOS versions, it is called demo_lksendcommand.sh:
#!/bin/sh
host=127.0.0.1
entrypoint=E1
epport=11500
user=admin
pass=admin
freetext="From lksendcommand"
encoding=""
mono lksendcommand.exe /F:XML/New-None.xml /U:$user /W:$pass /H:$host /P:$epport /E:$entrypoint /T:"$freetext" /O:NewResponse.xml /M:XML /C:$encoding /R
...
In the MV components there is a command called LK.DEMO.SENDCOMMAND that executes operations against any database connected to Linkar from BASIC.