Command Library

Introduction

Command library is a secure collection of commands stored centrally on the server. Command Library is a domain level entity. Hence it can be shared among different projects within the same domain. The user needs to add the command library to the domain if it resides solely on the domain level. Also, the user must have appropriate permission to create command library either on domain or project or both.

Create Command Library in domain

To create command library on the domain, select Command Libraries from page header in Domain drop-down menu.

This opens all Command Library list view workspace. The list view is labeled as Command Libraries (Domain) to differentiate with the project level command library list view. Right-click inside the list view to open the context menu and select New.

Alternatively, from the navigation menu select Big Plus Sign. Then the Create new command library pop up will appear, to enter the name of the command library

Click on Create, then Choose projects to import current item pop up will appear, to choose on which project/s will belong to the command library.

A new Command Library workspace is created. To add command definitions to the command library, select the Big Plus Sign from the navigation menu. There are eight different command definitions types available: RS232, Run Executable, File Deliver, File Retriever, Power Shell Script, Batch File Script, VB Script, WSH Script.

To create a new command definition choose one of the types of command, and the following window will appear; to enter the name of the custom command.

NOTE: Previous two steps are generic and are the same for creating all custom commands

RS232

RS232 is a serial communication port which is used for sending hardware codes (commands) to devices like TV, Display screens and etc. The hardware codes are device specific; which are provided only by the manufacturer. When the RS232 command is created the following window will appear.

The RS232 command definition is used to return back the status of the screen. If the CM Player is properly configured for a specific monitor with RS232 capability, it will return back the status of whether the monitor is turned on or not. Custom settings that must be configured for RS232 command definition are described below.

Data Consult manufacturer manual for the hexadecimal data to execute RS232 command.
COM Port Select the appropriate COM port on the player device.
Parity Consult manufacturer manual for the parity value of RS232 command.
Stop bits Consult manufacturer manual for the stop bits value of RS232 command.
Data bits Consult manufacturer manual for the data bits value of RS232 command.
Baud rate Consult manufacturer manual for the baud rate value of RS232 command.
Flow control Consult manufacturer manual for the flow control value of RS232 command.
Power code Consult manufacturer manual for the power code of the specific RS232 command.

Input the RS232 codes and in the navigation menu select the Save icon. After successful saving, the newly created command definition will be available in all Command Definition list view in the command library.

Also, the newly created command library will be shown in the all Command Libraries list view under the domain.

Run Executable

Run Executable command enables you to start the executable file on player/dappler machine. Run executable command definition workspace is in the picture below. In the description field add some description about the command definition if it is needed.

Attached File Name Use this to attach executable files from the machine. This text field is read-only, to add executable file select add button. Command line Parameter Use this text box to add some command parameters for the selected executable file such as /s to execute it silently.

Run Executable command definitions are used to execute already installed applications on the machine such as .exe (or other executable applications installed on the machine). Also, this command definition can be used to run previously created scripts (Shell, PowerShell, WSH etc.) Select add button to add, previously created PowerShell script. This opens up a new window to select appropriate executable file or script.

Click Open to add the selected script in this case, or Cancel to cancel adding. After adding the appropriate script, the script will be available in the Run Executable command definition workspace. The export button will become enabled, use this button to export the executable file. In the Command Line Parameters field, enter some command parameters such as /s to execute the command silently.

Save the Run Executable Command Definition from the ribbon or from the File menu. After successful saving, the newly created command definition will be available in all Command Definition list view in the command library.

File Deliver

File Deliver command is used to transfer data to the player/dappler machine. File deliver command definition workspace is in the picture below. In the description field, under the name field, add some description about the command definition if it is needed.

Destination FolderIn this text field add a proper destination path where to deliver files.
Attached File NameThis field shows the name of the selected file from the file list view.
ExportUse the Export button to export the file to a different location and with a different name. This button is enabled only when a file is selected.
Command Line ParameterIn this text field add some command parameter for the selected file such as /s to execute silently.
Execute after deliveryCheck this checkbox to execute the selected file after successful delivery. This check box becomes enable only when the file(s) is selected.
Add FilesSelect this button to add files to be delivered. This opens up a new window. Select the files you want to deliver and select open to add them in the all files list view.
Add FolderSelect this button to add a folder to deliver. This opens up a new window to select the folder you want to deliver. Select the appropriate folder and click open to add selected folder or cancel to cancel adding operation.
UpUse this button to move the selected file(s) up in the all files list view.
DownUse this button to move the selected file(s) down in the all files list view.
DeleteUse delete button to delete the selected file or folder. A confirmation dialog will open to confirm delete action. Multiple files or folders can be deleted using this button.

Set all the required settings in the File Deliver workspace and save the File Deliver Command Definition.

After successful saving, the newly created command definition will be available in all Command Definition list view in the command library.

NOTE: To execute files after delivery UAC (User Account Control) settings must be turned off. To turn off select Change User Account Control settings from the start menu (type UAC or User Account Settings in the search field), and change settings to never notify.

File Retriever

File Retriever command is used to transfer data to the player/dappler machine. File Retriever command definition workspace is in the picture below. In the description field, under the name field, add some description about the command definition if it is needed.

Field name Description
Folder PathAbsolute path to the folder on the player machine from which we intend to retrieve the files
File Name/PatternName of the file in the player machine or wildcard patterns for listing groups of files

Power Shell Script

Powershell script commands are used for executing powershell scripts on the playermachine. This should open up the power shell script command definition workspace. In the description field, under the name field, add some description about the command definition if it is needed.

In Power Shell Script, Commandline Parameter text field, and the blank text area for script definition is available. In The Commandline Parameter text field, add some command parameter for the Power Shell Script such as /s, to run power shell script silently. In the text area of the power shell script command definition workspace, enter the code of the power shell script such as:

$computer = “LocalHost” $namespace = “root\CIMV2” Get-WmiObject -class Win32_DesktopMonitor -computername $computer -namespace $namespace

Add the power shell script code in the Power Shell Script workspace and save the Power Shell Script Command Definition.

After successful saving, the newly created command definition will be available in all Command Definition list view in the command library.

Batch File Script

Batch File Scripts commands are used for executing batch scripts on the player machine. This should open up the batch file script command definition workspace. In the name field, add an appropriate name for the command definition such as “Batch File Script Command Definition”. In the description field, under the name field, add some description about the command definition if it is needed.

In Batch File Script, Commandline Parameter text field, and blank text area for script definition are available. In the text box field, create some batch file code such as OpenWord batch file definition:

@echo off REM Next command opens Microsoft Word start /d “C:\Program Files (x86)\Microsoft Office\Office15” WINWORD.EXE

In the Command line parameter text field enter some command parameter such as /s to run the batch file silently. Add the batch file script code in the Batch File Script workspace and save the Batch File Script Command Definition.

batch_file_command_saved.jpg?&630| }}

After successful saving, the newly created command definition will be available in all Command Definition list view in the command library.

VB Script

This should open up the VB script command definition workspace. In the name field, add the appropriate name for the command definition such as VB Script Command Definition. In the description field, under the name field, add some description about the command definition if it is needed.

In VB Script, Commandline Parameter text field, and blank text area for script definition are available. In Commandline Parameters field, enter some command parameter such as /s which means to run script silently. In the text box field, create some VB script code such as:

dim filesys set filesys=CreateObject(“Scripting.FileSystemObject”) if filesys.FolderExists(“c:\cop”) Then filesys.CopyFolder “c:\cop”, “c:\cop1” end if

Add the VB script code in the VB Script workspace and save the VB Script Command Definition.

After successful saving, the newly created command definition will be available in all Command Definition list view in the command library.

WSH Script

WSH script command is used for executing WSH scripts on player/dappler machine. WSH script command definition workspace is in the picture below. In the description field, under the name field, add some description about the command definition if it is needed.

In WSH Script workspace, Script Type dropdown menu, Run silently check box, Commandline Parameter text field, and blank text area for script definition are available. From the Script Type drop down menu select the type of the script you will use for the command definition. Different script types are available such as: VBS, JS, PLS, PYS, PHPS, RBS, RXS, TCLS and WSF. To run script silently check Run silently check box.

For example, for the script type, select WSF. In Commandline Parameters field, enter some command parameter such as /s which means to run script silently, or some other command parameter. In the text box field, enter WSH script code proper for the selected script type. For example, for the selected WSF script type, enter the following script code:

<job> <script language=“VBScript”> dim filesys set filesys=CreateObject(“Scripting.FileSystemObject”) If filesys.FolderExists(“c:\cop”) Then filesys.CopyFolder “c:\cop”, “c:\cop1” End If </script> <script language=“JScript”> WSH.echo(“Message from FOXFORD”); </script> </job>

Add the proper WSH script code for the WSF script type in the WSH Script workspace and save the WSH Script Command Definition.

After successful saving, the newly created command definition will be available in all Command Definition list view in the command library.

Create Command Library in the project

To create command library in a project, select Command Libraries from Project Explorer under Domain tree view.

This opens all Command Library list view workspace. The list view is labeled as Command Libraries (Project) to differentiate with the domain level command library list view.

Right-click inside the list view to open the context menu and select New.

A new Command Library workspace is created. To add command definitions to the command library, select the appropriate ribbon button from the Command tab in the ribbon. Seven different types of command definitions are available: RS232, Run Executable, File Deliver, Power Shell Script, Batch File Script, VB Script, WSH Script.

Also in the opened new command library workspace, right click and select New from the context menu to create new command definition.

After choosing the command type, there will be pop up to enter the name of the command.

After the name is entered, click on Create and the command workspace will be open.

Add Command Library to project

If the Command Library exists solely in the domain level, then it needs to be added to the project before it can be used for the individual project. To add existing domain level Command Library to project, open Command Library from Project Explorer under Project tree view. Select Import Command Library from Home tab in the ribbon.

Alternatively, right-click inside the all Command Libraries list view to open the context menu, and select Add Existing Command Library.

This will open the window with Command Libraries that do not exist in the currently opened project.

Select the desired Command Libraries in the Command Library list and click OK to add selected Library to project Command Libraries. The selected Command Libraries will be added successfully to the project. Command Libraries now will be available in the project Command Libraries list view.