Please note that in case several instances of the Softros LAN Messenger are running on the same machine (if it is a terminal server for example) and the message is sent using an IP address or computer name, all online users of Softros LAN messenger on the machine will receive the message.

Messaging and File Sending Automation with Command Line

Softros LAN Messenger offers two ways to integrate message sending via Softros LAN Messenger from your app or script. The simpler way is represented in a form of a command-line tool and deeper integration is possible with a dynamic link library (DLL). Both methods require:

Sending Messages and Files using Command Line

Softros LAN Messenger’s messaging/file sending automation can be done by command-line utility MessengerCMD.exe, located in the Softros LAN Messenger installation folder, SDK subfolder. After the program is installed the MessengerCMD command is available from any working directory, so there is no need to use the full path to call it. The tool cannot be used on a system where Softros LAN Messenger is not installed and running.

With MessengerCMD you can:

Usage:
MessengerCmd –SendMessage –t:TypeOfRecipient –r:Recipient –m:MessageText
MessengerCmd -SendFiles -t:TypeofRecipient -r:Recipient -f:ListOfFiles [-m:MessageText]

Command line parameters for MessengerCMD

ParameterDescription
-SendMessageSends a message
-SendFilesSends files and folders
-t:TypeOfRecipient The type of Recipient must be one of the parameters listed in the Recipient Types section below.
-r:Recipient Recipient. The format depends on the type. Can be omitted only if TypeOfRecipient is All. See the Recipient Types section below.
-ListOfFiles List of paths pointing to a file, folder, or a list of files.
  • Multiple items must be separated by vertical bars |
  • Wildcards are supported (* , ?)
  • Paths starting with the @ sign point to multi-line text files where each new line is the path to a file that needs to be sent
-m:MessageText Text of the message to be sent. Message text must be in double quotes in case any space characters are present in the message. Any double quote characters inside the message are stripped. For multi-line messages, \r\n must be used as a line break.

Recipient Types

Depending on the information known about the recipient one of the following recipient types must be used.

Recipient TypeUtility behavior
UID Sends a message to a user using their UID. To retrieve the UID, right-click the user’s name in the list, and then click Get Information.
  • Sends messages to online and offline users.
  • Sends files to online users only.
  • Case insensitive.
Example: MessengerCmd –SendMessage –t:UID –r:A341468500 –m:"message text"
IP Sends a message to an IP address.
  • Sends to online users only.
  • IPv6 is not supported.
Example: MessengerCmd –SendMessage –t:IP –r:192.168.81.1 –m:"message text"
PCName Sends a message to a machine by its name.
  • Sends to online users only.
  • Case insensitive.
Example: MessengerCmd –SendMessage –t:PCName –r:MYDESKTOP –m:"message text"
UserName Sends a message to a user using their exact username.
  • Sends messages to online and offline users.
  • Sends files to online users only.
  • Case sensitive.
  • Username must be in double quotes in case any space characters are present in it.
Example: MessengerCmd –SendMessage –t:UserName –r:"John Hopkins" –m:"message text"
Group Sends a message to all members of a group using the group’s exact name.
  • Sends messages to online and offline users.
  • Sends files to online users only.
  • Case sensitive.
  • The group name must be in double quotes in case any space characters are present in it.
Example: MessengerCmd –SendMessage –t:Group –r:"Accounting dept." –m:"message text"
All Sends a message to all users on the list, both online and offline. Sends a files to all online users on the list.

Example: MessengerCmd –SendMessage –t:All –m:"message text"

Return codes for MessengerCMD.exe

Return CodeDescription
0The command has been executed successfully.
1Error: The recipient has not been found.
2Error: The SDK API is not enabled in the Admin.ini.
3Error: Softros LAN Messenger is not running.
4Error: Required files not found. Reinstall the Softros LAN Messenger.

Successful execution of the command does not guarantee the message or file has been received by the recipient. For example, in case the recipient is offline, the message is stored for later delivery, while files can be sent only to online users.