Skip to main content

Running the Terminal Application from the Command Line

You can start the Terminal application from the Windows command line. When you do this, you have options for specifying the server to connect to, the namespace to access, code to run, and the window size and position. You can run routines, and you can also run Terminal scripts.

Starting the Terminal Application from the Command Line

To start the Terminal application from a Windows command line, use a command with one of the following general forms:

  • To connect to the local instance:

    iristerm /console=ConnectString Arg1 Arg2 ... ArgN ScriptFilePath
    
  • To connect to a remote instance:

    iristerm /server=ConnectString Arg1 Arg2 ... ArgN ScriptFilePath
    
  • To start the application without any connection:

    iristerm Arg1 Arg2 ... ArgN ScriptFilePath
    
    Note:

    If you start the Terminal application in this way, the menu bar displays an additional menu — the Connect menu — which you can use to connect to an instance.

Where:

  • ConnectString indicates the instance to connect to. See Connection Options.

  • Arg1 ... ArgN are additional optional arguments, separated by spaces. These arguments specify the server to connect to, and provide other information about the starting environment for the session. You can also specify the name of a routine to run.

  • ScriptFilePath is the optional pathname of the script file to execute.

If the PATH environment variable includes the location of the InterSystems IRIS® data platform binaries, then use the command name iristerm or iristerm.exe. Otherwise, you must use a full or partial path. For a default installation of InterSystems IRIS, the binaries are in the directory install-dir\Bin

Connection Options

When you start the Terminal application from the Windows command line, you can include the /console argument, the /server argument, or neither. The following variations are accepted:

/console=cn_iptcp:HostAddr

This syntax specifies the target system with which the Terminal application is to interact over a TELNET connection. This is useful for running a script on the local machine. In this case, you specify the local machine IP address and port as HostAddr. For example:

iristerm /console=cn_iptcp:127.0.0.1[23]
/console=cn_ap:Instance[Namespace]

This syntax connects to a local instance and switches to the given namespace (if given). For example:

iristerm /console=cn_ap:iris[USER]

In this case, the instance name is iris, and the namespace name is USER.

The namespace name is optional. If it is not supplied, the default namespace is used.

/console=cn_ap:Instance[Namespace]:Routine

This syntax connects to a local instance, switches to the given namespace, and executes the given routine. For example:

iristerm /console=cn_ap:iris[USER]:^^%%D

In this case, the instance name is iris, and the namespace name is USER. The routine name is ^%D (which prints out the current date).

The namespace name is optional. If it is not supplied, the default namespace is used.

When the routine ends, the session is closed.

/server=ServerName

This syntax connects securely to a remote server. For example:

iristerm /server=TESTIRIS

For ServerName, specify an InterSystems IRIS server. To see the list of available servers, select the InterSystems Launcher and then select Preferred Server. The system then displays a list of servers.

In order to access the server in this way, make sure of the following:

  • On the desired server, the Telnet service (%Service_Telnet) must be enabled. (Note that this service is not enabled by default.)

    For information, see “Services” in the Security Administration Guide.

  • The server must be running.

    On UNIX®, the server does not need to be running, but you will log in to a shell, not directly in to InterSystems IRIS.

Additional Arguments

You can also include the following additional arguments:

/size=RowsxCols

Specifies the initial size of the Terminal application screen, in terms of rows and columns. Both Rows and Cols must be unsigned integers. The x that separates them is required as shown. No spaces are permitted in the control argument.

The allowed ranges for Rows and Cols are:

  • 5 <= Rows <= 64

  • 20 <= Cols <= 132

/pos=(X,Y)

Specifies the initial origin of the Terminal application screen in the display device window in pixels. Both X and Y must be unsigned integers. The parentheses around the pair and the comma separator are required. No spaces are permitted in the control argument.

Note:

It is possible to place a window outside the displayed area by using values for X and Y that are larger than the size of the display device. You should avoid doing so.

/ppos=(Xpct,Ypct)

Specifies the initial origin of the Terminal application screen in the display device window in terms of a percentage of the display area. Both Xpct and Ypct must be unsigned integers. The parentheses around the pair and the comma separator are required. No spaces are permitted in the control argument.

The allowed ranges for XPct and Ypct are:

  • 0 <= Xpct <= 40

  • 0 <= Ypct <= 40

That is, the window origin cannot be placed above and to the left of the device origin. Nor can it be placed more than 40% down or across the display device.

/UnbufferedLogging

Causes output to be written immediately to the log file when logging is active instead of being buffered. This may be useful if another process is inspecting the output of the log file.

Examples

Example: Running a Script in Batch Mode

This example runs a script in batch mode:

C:\InterSystems\iris\bin\iristerm.exe /console=cn_iptcp:127.0.0.1[23] C:\TestScript.scr

Example: Running a Routine

This example starts the Terminal application and starts the basic debugging routine ^%STACK to display information about the current user and the Terminal application process:

C:\InterSystems\iris\bin\iristerm.exe /console=cn_ap:iris[USER]:^^%STACK
FeedbackOpens in a new tab