# Quick Beginnings

# Starting and Stopping Emulator Sessions

This chapter describes how to start and stop single and multiple emulator sessions.

If you saved your emulator configuration information, as described in Saving Configuration Information, it is stored in a workstation profile (*.WS), which should be displayed in the Session Manager.

Note:
  If you are a first-time user of Personal Communications, or there are no session icons in the Session Manager, see Configuring Sessions to create a configuration.

## Session Manager

Personal Communications uses the Session Manager dialog to provide easy access to workstation profiles and batch files. You can use the Session Manager to start a single or multiple sessions, and create a new session or batch file.

Note:
  The Session Manager dialog only displays workstation profiles and batch files that are located in the Application Data location that was specified during Personal Communications installation. See Application Data for more information about application data.

You can drag an icon from the Session Manager to the Windows Start menu or to the desktop. Select one or more sessions and drag with the right mouse button. A contextual menu appears when the icons are dropped, which gives you the options for moving, copying, or creating a shortcut. If you drag an icon with the left mouse button held down, the icon is moved to that location. If you drag an icon while pressing the Ctrl key and with the left mouse button held down, the icon is copied to that location. If you drag an icon while pressing the Alt key and with the left mouse button held down, a shortcut is created for the icon.

You should use the shortcut option whenever possible. Moving and copying will affect the location (and therefore the function) of the profile. Specifically, when you copy a profile to the desktop instead of creating a shortcut, you have actually created another profile. Any changes you make to the desktop profile will not be reflected in the original profile (and vice versa). Also, the desktop profile is located in the desktop folder (not in the application data folder) and will not appear in the Session Manager--the original version of the profile remains in the Session Manager.

### Session Manager Options

Various Session Manager options are available from the pull-down menus and the right-click menu. For example, you can customize the look of the displayed Session Manager information and import sessions or batch files into the Personal Communications Application Data directory.

#### Session Manager Menus

The following options are available from the Session Manager menus.

File

  Change Directory
    You can run files that are stored in a directory other than the Personal Communications Application Data directory.

  Import
    This option allows you to copy sessions or batch files to the Personal Communications Application Data directory. Afterwards, the imported files can be displayed in the Session Manager dialog.

View

  Sessions
    This option shows all valid workstation profiles that have the standard .WS extension and are located in the Application Data directory.

  Multiple Sessions
    This option shows all valid batch files that are have the standard .BCH extension and are located in the Application Data directory.

  All File Extensions
    This option shows all valid multiple sessions and workstation profiles that are located in the Application Data directory, regardless of extension.

  Hidden
    This option shows files that have been previously hidden using the right-click menu option. If this option is selected, hidden sessions are shown with black-and-white icons; otherwise, they will not be displayed.

  Large Icons
    This option shows large session icons in the Session Manager.

  Small Icons
    This option shows small session icons in the Session Manager.

  Details
    The following session detail information is displayed in the panel columns. The columns can be resized as needed.
    - File Name
    - File extension
    - Type (session or batch file)
    - Description (shows the information specified in the `Description=` field in the .WS file)
    - The following session information is not shown for batch files.
      - Host Name (if SNA, this column shows the .ACG file name).
      - Host Type (shows the host type specified in the Customize Communication dialog during session configuration)
      - Interface (shows the interface specified in the Customize Communication dialog during session configuration)
      - Attachment (shows the attachment specified in the Customize Communication dialog during session configuration)
      - Session Type (printer or display)
    - Modified (indicates the last modification date/time of the file)

  Refresh
    If you manually copy a session or batch file into the Application Data directory, you must refresh the Session Manager view in order to see the new files.

#### Right-Click Menu (Contextual)

The following options are available by right-clicking on one or more session.

Start
  Starts the selected sessions

Delete
  Deletes the selected sessions. You must have permission in the System Policy to delete any sessions from the Session Manager.

Hide/Unhide
  You can hide or unhide sessions using this option. To view hidden sessions, you must select View -> Hidden. Hidden sessions have black-and-white icons when displayed.

Modify
  This option is only available when selecting one or more batch files--the batch files are brought up in edit mode. You must have permission in the System Policy to modify batch files from the Session Manager.

## Starting Sessions

You can use the following methods to start sessions:

- Select a previously configured session icon from the Session Manager.
- Start from an existing session window.
- Specify a workstation profile name in the Run window.
- Enter the PCOMSTRT command in the Run window or MS-DOS prompt.
- Select an icon that has been previously dragged from the Session Manager.
- Start multiple sessions with a batch file.

Note:
  Connection status messages are displayed on a status bar at the bottom of your session window during connection to the host.

Starting from the Start or Configure Sessions Icon
  Select Programs -> IBM Personal Communications -> Start or Configure Sessions from the Start menu. Select the desired session from the Session Manager dialog and click the Start button.

Starting from an Existing Session Window
  Use the following methods to start from an existing session window:

  Starting Another Session Using the Same Profile
    Select Run the Same from the File menu. Another session starts, using the same profile.

  Starting Another Session Using a Different Profile
    1. Select Run Other from the File menu.

       The Open Other Workstation Profile window appears.

    2. Double-click the desired workstation profile in the File Name list.
    3. Select OK.

       Another session starts, using the profile specified in step 2.

  Starting a Different Type of Session from a Session Window
    1. Select Open from the File menu.
    2. Specify the desired workstation profile and then select OK.

       The current session ends and then another session starts, using the selected profile.

Starting Using a Command
  To start a session, use the following procedure:
  1. Start a DOS command prompt.
  2. Enter the command

           PCOMSTRT /P=x:\AppData\my.WS

     where `my.WS` is the workstation profile stored in the Application Data directory specified during installation. This is the only required parameter.

     Note:
       If multiple `/p` parameters are given, PCOMSTRT only uses the last one to start a profile (.WS file).

     For a complete description of parameters, refer to Administrator's Guide and Reference.

  Another method for invoking Personal Communications using a command is with the command for the PCSWS.EXE module (see PCSWS.EXE Options).

## Starting Multiple Sessions

If you installed the Multiple Sessions utility, you can use the batch program PCSWS.EXE, which runs batch files (*.BCH), to start two or more workstation profiles at the same time. Personal Communications batch files can also start other programs when you include their startup commands. This is especially useful if you always want to start an application when you start a session. For example, you might want to start an application, such as ZipPrint, that uses a Personal Communications API.

Note:
  You must have permission in the System Policy in order to create a new batch file.

If you created an icon for your batch file, double-click the icon in the Session Manager or select the icon and click the Start button.

### PCSWS.EXE Options

You can use the following options when creating or modifying a batch file.

- To specify which view should be used during a session, add the command `/V=myview`, where `myview` is the name of the previously saved view:

       C:\Pcomm\PCSWS.EXE C:\AppData\LAN1.WS /V=myview

  If the specified view does not exist, the command is ignored. See Managing Emulator Sessions for information on how to save a view.
- To suppress the IBM logo when you start one or more sessions, add the parameter `/Q` to the first command in the batch file:

       C:\Pcomm\PCSWS.EXE C:\AppData\TCPIP1.WS /Q

  where `C:\Pcomm\` is the directory where you have Personal Communications installed, and C:\AppData\ is the Application Data directory.
- To start a session as an icon, not as a window, add the parameter `/I` to the command in the batch file:

        C:\Pcomm\PCSWS.EXE C:\AppData\TWINAX.WS /I

  where `C:\Pcomm\` is the directory where you have Personal Communications installed, and C:\AppData\ is the Application Data directory.
- To start a hidden session, not as an icon or a window, add the parameter `/H` to the command in the batch file:

        C:\Pcomm\PCSWS.EXE C:\AppData\TWINAX.WS /H

  where `C:\Pcomm\` is the directory where you have Personal Communications installed, and C:\AppData\ is the Application Data directory.
- To start a session with a specific short session ID (session letter), insert the parameter `/S=m` after PCSWS.EXE in the batch file:

        C:\Pcomm\PCSWS.EXE /S=m C:\AppData\LAN1.WS

  where `C:\Pcomm\` is the directory where you have Personal Communications installed, `m` is the short session ID, and `C:\AppData\` is the Application Data directory.

Notes:

1. If you use the /S option to assign A as the short session ID, you should use this option for all of the sessions in the batch file. Otherwise, if another session starts first, it becomes the A Session and the session with the `/S=a` option will not start because of the conflicting short session IDs. Another way to prevent conflicts is to assign a character later in the alphabet for the short session ID.

2. Several parameters can be specified for controlling the particular characteristics for starting sessions; the switch values are designated by a single character.

### Creating a Batch File

To create a batch file, use the following procedure:

1. From the Session Manager dialog, click New Multiple Sessions. You can also start a new batch file from the Windows Start menu, using the IBM Personal Communications -> Utilities -> Multiple Sessions program.

   The Create/Modify Batch File panel appears.

2. There are several methods for including profiles or programs in a batch file:
   - Double-click the file names in the File Name list box.
   - Drag and drop the file names (using the right mouse button) from the File Name box to Batch-File Entries.
   - Select a file name from the File Name list box and then select Add.
   - Type the complete path and command file name in the batch files entries area.
   - You can also use the Capture View button to capture multiple session windows into a view.

   Personal Communications places the full path and command that is needed to run the workstation profile or other program above the cursor line in the edit area. If there is no cursor, the command is added to the last line.

   To see the contents of the profile you added to the batch file, click it in the File Name list box and then click View File or the magnifying glass.

   Note:
     Some brief instructions appear at the top of Batch-File Entries; you need not remove them, because they do not affect the running of the batch file.

     There is one exception--if you are using the Japanese version of Personal Communications, you must delete these instructions. One way to do this is to select File -> New from the Create/Modify Batch File dialog before adding any files.

3. Repeat step 2 for each subsequent file to be added.
4. When you complete the edit, save the created batch file by selecting Save from the File menu.

   The Save Batch File As window appears.

5. Enter a name for the batch file (*.BCH).

   The name you enter is used as the icon title, unless you enter a description as well.

The following example is a batch file that runs six workstation profiles located in the Application Data directory, and then runs MYAPP.EXE.

    C:\dir\PCSWS.EXE C:\dir\COAX1.WS /Q
    C:\dir\PCSWS.EXE C:\AppData\COAX2.WS /I
    C:\dir\PCSWS.EXE C:\AppData\SLAN1.WS
    C:\dir\PCSWS.EXE C:\AppData\SLAN2.WS
    C:\dir\PCSWS.EXE C:\AppData\AS4Y1.WS
    C:\dir\PCSWS.EXE C:\AppData\VT220.WS
    C:\APPL\MYAPP.EXE

where `C:\AppData` is the Application Data directory specified during installation and `dir` is the installation directory.

#### Saving Multiple Session Views

You can use the Create/Modify Batch File panel to capture up to multiple session views. Simply size and position up to 26 session windows and click the Capture View button. Name the view and click Save View in the View Setup panel. You can save up to eight views. You may also delete previously saved views from the drop-down list in the View Setup panel.

If a view is already being used when you click Capture View, that view is automatically used and you are not prompted to save a new view.

### Starting a Batch File

You can use one of the following methods to run a batch file:

- If you created an icon for your batch file, double-click the icon in the Session Manager or select the icon and click the Start button.
- Run the batch file from the Run command line:

        [drive]:\[path]\PCSBAT.EXE  [drive]:\[path]\xxxx.BCH /R

  Note:
    To run a batch file, specify the /R option.
- Start the Multiple Sessions Utility.
  1. Select Open from the File menu in the Create/Modify Batch File window.
  2. Select the desired batch file and then select OK.

     The contents of the batch file appears in the edit area.

  3. Select Run from the Run menu.

### Editing an Existing Batch File

To edit an existing batch file, do one of the following:

- Right-click on the icon in the Session Manager and choose Modify.

  You can also use the following procedure:

  1. Start the Multiple Sessions Utility from the Start menu. The Create/Modify Batch File window appears.
  2. Select Open from the File menu. The Open Batch File window appears.
  3. Select the batch file you want to edit and then select OK. The contents of the batch file you selected appear in the edit area of the Create/Modify Batch File window.
- Edit the batch file. See step 2 for more details.
- When you complete the edit, save your changes by selecting Save or Save As from the File menu.
  - Select Save to save your changes in the existing file.
  - Select Save As to save your changes in a new file and then continue with step 5.
- Exit the Create/Modify window.

### Starting Multiple Sessions without a Batch File

To start multiple sessions without a batch file, use the following procedure:

1. Start the Session Manager.
2. Select the icons for the sessions, then click the Start button. You can select icons using a drag selection box or holding down the Ctrl key while selecting icons with the mouse.
3. After it connects to the host, select one of the following choices from the File menu:
   - Run the Same to start another session with the same configuration.
   - Run Other to start a session with a different configuration.

     When the Open Other Workstation window appears, select the profile you want to start and then click OK.

## Automatically Starting Sessions

To start one or more sessions automatically, use the following procedure:

1. From the Start menu, select Settings -> Taskbar.
2. Click the Start Menu Programs tab and then click Add.
3. Click Browse and then open the Application Data directory specified during installation.
4. Change the file type to `All Files`.
5. Double-click the session icon or the batch icon.
6. Click Next and then double-click the Startup folder.
7. Accept the icon name or type a new one.
8. Click Finish and then OK when you are done.

You can also drag an icon from the Session Manager to the Startup folder as a shortcut.

## Stopping Sessions

To stop a session, click the X in the upper right corner or double-click the upper left corner of the session window, or select Exit from the File menu.

To stop multiple sessions at the same time, select Exit All from the File menu. All emulator sessions end, and the associated session windows are closed.

Sessions can also be stopped using a command:

1. Select Run or Programs -> MS-DOS Prompt from the Start menu.
2. Enter one of the following commands:

          PCOMSTOP /S=x
          PCOMSTOP /ALL

   where `x` is the session letter of the particular session to be stopped; use `ALL` to stop all active sessions. There are other parameters; for a complete description, refer to Emulator User's Reference.

Note:
  Stopping a Telnet session automatically closes an associated printer session, if that option was selected when configuring the session. See Printer Session Association for information on how to automatically close an associated printer session.

[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]