CprMgCmd.exe CLI utility commands

I would like to use CprMgrCmd.exe CLI instead of CPR manager GUI interface. What are the commands?


In order to use the CprMgrCmd.exe CLI utility, you must have Command Line CPR 4.1.x.x or CPR Manager 4.1.x.x or higher installed, and the CLI commands must be issued from directory where CPR is installed. By default, CPR is installed in: C:\Program Files\Lantronix\CPR\

The latest version of the CPR is available from http://www.lantronix.com/support/downloads.html#soft

To issue CPR CLI commands, you must be at the CprMgrCmd prompt (>) :
ex: C:\ProgramFiles\Lantronix\CPR>cprmgrcmd.exe
> numports

or

CPR CLI commands must have 'cprmgrcmd' preceding the command:
ex: C:\ProgramFiles\Lantronix\CPR>cprmgrcmd numports

This method allows CPR CLI commands to be run from a batch file.

Below are all the commands for CprMgrCmd.exe CLI and their options in alphabetical order.

? print help to screen. No need to press the return key.
/ print help to screen. No need to press the return key.

Creating com ports, adding services:

addport <Port>
Add a CPR port to the system using default values.
<Port>: Port Number. (ports 0 and >256 are invalid)

addservice <Port> <IP> <Tcp Port>
Add a new service to a CPR port.
<Port>: Port Number. (ports 0 and >256 are invalid)
<IP>: IP Address of device
<Tcp Port>: Tcp Port number to use

Display Commands:

default
Get the default port info.

devinfo <Port>
Display the Device Info for the specified port.
<Port>: Port Number. (ports 0 and >256 are invalid)

numports
Display the number of CPR ports configured on this system.

portinfo <Port>
Display the Port Info for the specified port.
<Port>: Port Number. (ports 0 and >256 are invalid)

portmap
Display the CPR Port Map.

portstatus <Port>
Display the Port Status for the specified port.
<Port>: Port Number. (ports 0 and >256 are invalid)

portusage
Display Port Usage Array.

Export & Import Config File:

exportcpc <File>
Export port definitions to a Com Port Config file.
<File>: Com Port Config File Name

importcpc <File> [-s] [-a] [-n]
Import port definitions from a Com Port Config file.
<File>: Com Port Config File Name
-s: Do not print returned PortInfo structures
-a: Add ports to system
-n: No prompt

Remove ports, remove services, modify services:

remall [-s] [-n]
Remove all CPR ports from the system.
-s: Do not print results
-n: No prompt

remport <Port>
Remove a CPR port from the system.
<Port>: Port Number. (ports 0 and >256 are invalid)

remservice <Port> <Service #>
Remove a service from a CPR port.
<Port>: Port Number. (ports 0 and >256 are invalid)
<Service #>: The service number from 1 to 8

To modify existing service:

setservice <Port> <Service #> <IP> <Tcp Port>
Set (Modify) an existing service of a CPR port.
<Port>: Port Number. (ports 0 and >256 are invalid)
<Service #>: The service number from 1 to 8
<IP>: IP Address of device
<Tcp Port>: Tcp Port number to use

Search Functions:

find [-n] [-tN]
Find devices on the network.
-n: Print Names
-t: Timeout in milliseconds (ie. -t1000 = 1 second timeout)

getnames <IP> [-tN]
Get device and port names for a device.
<IP>: IP Address of device
-t: Timeout in milliseconds (ie. -t1000 = 1 second timeout)

Set default settings, Set information per port, set device names & ports, modify existing services:

setdefinfo [-aN] [-rN] [-cN] [-dN] [-uN] [-tN] [-bN] [-kN] [-mN] [-iN] [-LN] [-N]
Set default information used when creating ports.
-a: Auto Reconnect on error. (No = -a0, Yes = -a1)
-r: Reconnect attempts. (forever = -r0)
-c: Connection timeout in seconds. (ie. -c6 = 6 seconds)
-d: DTR Connection.
0 = Tie DTR to DCD, DSR kept active
2 = Tie DTR to DSR, DCD kept active
3 = Tie DTR to DSR, DCD kept inactive
4 = Tie DTR to DSR and DCD, DSR kept active
-u: Use RFC2217. (No = -u0, Yes = -u1)
-t: Transmit Empty. (0 = CPR, 1 = Device Server)
-b: Buffer Writes. (No = -b0, Yes = -b1)
-k: TCP KeepAlive. (No = -k0, Yes = -k1)
-m: KeepAlive Time (msec)
-i: KeepAlive Interval (msec)
-L: Listen Mode. (None = -L0, Normal = -L1, Auto = -L2
-p: Listen Mode TCP Port

setinfo <Port> [-aN] [-rN] [-cN] [-dN] [-uN] [-tN] [-bN] [-kN] [-mN] [-iN] [-LN] [-pN]
Set information on a port.
<Port>: Port Number. (ports 0 and >256 are invalid)
-a: Auto Reconnect on error. (No = -a0, Yes = -a1)
-r: Reconnect attempts. (forever = -r0)
-c: Connection timeout in seconds. (ie. -c6 = 6 seconds)
-d: DTR Connection.
0 = Tie DTR to DCD, DSR kept active
1 = Tie DTR to DCD, DSR kept inactive
2 = Tie DTR to DSR, DCD kept active
3 = Tie DTR to DSR, DCD kept inactive
4 = Tie DTR to DSR and DCD, DSR kept active
-u: Use RFC2217. (No = -u0, Yes = -u1)
-t: Transmit Empty. (0 = CPR, 1 = Device Server)
-b: Buffer Writes. (No = -b0, Yes = -b1)
-k: TCP KeepAlive. (No = -k0, Yes = -k1)
-m: KeepAlive Time (msec)
-i: KeepAlive Interval (msec)
-L: Listen Mode. (None = -L0, Normal = -L1, Auto = -L2
-p: Listen Mode TCP Port

setnames <IP> [-d<"device name>"] [-1<"port 1 name>"] [-2<"port 2 name>"] [-tN]
Set device and port names for a device.
<IP>: IP Address of device
-d<device name>: Name of device (use " to preserve spaces)
-d<port 1 name>: Name of TCP port 1 (ie. -1"Port 1 Name")
-d<port 2 name>: Name of TCP port 2 (if 2 port device)
-t: Timeout in milliseconds (ie. -t1000 = 1 second timeout)

setservice <Port> <Service #> <IP> <Tcp Port>
Set (Modify) an existing service of a CPR port.
<Port>: Port Number. (ports 0 and >256 are invalid)
<Service #>: The service number from 1 to 8
<IP>: IP Address of device
<Tcp Port>: Tcp Port number to use

Utility Functions:

loopback [-cN-N,N] [-tN] [-eN] [-r] [-dN] [-nN] [-pN]
Loopback test. A loopback adapter is required.
-c: Com ports to test.(List. N-N is range. Defaults to all)
-t: Number of threads. (Defaults to 1)
-e: Print errors. (No(default) = -e0, Yes = -e1)
-r: Randomly assign Com Ports to threads.
-s: Size of data packet. (Defaults to 100)
-d: Number of data runs per open. (Defaults to 1)
-p: Print interval in seconds. (Defaults to 10 seconds)

prompt <string>
Change the prompt.
<string>: New prompt

reach <IP> [-tN]
Discover if device is reachable.
<IP>: IP Address of device
-t: Timeout in milliseconds (ie. -t1000 = 1 second timeout)

query <IP> [-tN]
Query information for one device.
<IP>: IP Address of device
-t: Timeout in milliseconds (ie. -t1000 = 1 second timeout)

quit
quit program (or Ctrl-C).

ver
Get CPR Driver and CPR Interface DLL versions.



[Originally Published On: 07/11/2007 11:51 AM]