Command line options for PCSWS.EXE

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:\ZIEWin\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 HCL logo when you start one or more sessions, add the parameter /Q to the first command in the batch file:
     C:\ZIEWin\PCSWS.EXE C:\AppData\TCPIP1.WS /Q
    where C:\ZIEWin\ is the directory where you have Z and I Emulator for Windows 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:\ZIEWin\PCSWS.EXE C:\AppData\LAN1.WS /I
    where C:\ZIEWin\ is the directory where you have Z and I Emulator for Windows 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:\ZIEWin\PCSWS.EXE C:\AppData\LAN1.WS /H
    where C:\ZIEWin\ is the directory where you have Z and I Emulator for Windows 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:\ZIEWin\PCSWS.EXE /S=m C:\AppData\LAN1.WS
    where C:\ZIEWin\ is the directory where you have Z and I Emulator for Windows installed, m is the short session ID, and C:\AppData\ is the Application Data directory.
  • To start a macro after the session start, add the parameter /M to the command in the batch file:
     C:\ZIEWin\PCSWS.EXE C:\AppData\LAN1.WS /M=mymacro 
    where C:\ZIEWin\ is the directory where you have Z and I Emulator for Windows installed, C:\AppData\ is the Application Data directory,
    LAN1.WS
    is the profile, and
    mymacro
    is the Z and I Emulator for Windows macro/script file name.

    If the specified macro/script does not exist, there will be a pop up with "PCSKBD400- The file: <macro name> is not a Z and I Emulator for Windows macro/script-file."

Note:
  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 New Session using Command Line

HCL Z and I Emulator for Windows supports command-line functionality that enables users to easily launch a new non-secure session by specifying parameters such as host type, hostname, and port number, allowing quick and efficient connections.

Use the following command syntex to start a new Session:

Command Syntax:
pcsws.exe <Host Type> <Hostname> <Port> </n>

Breakdown of Parameters:

  • <Host Type>: Specifies the type of host. It can be:
    • 5250 or iSeries: For iSeries (AS/400) systems.
    • 3270 or zSeries: For mainframe (zSeries) systems.
    • ASCII: For text-based communication.
  • <Hostname>: The hostname or IP address of the target system.
  • <Port>: The port number used for the connection to the host.
  • </n>: A command-line option that indicates a new session should be created.

    Example:

    To connect using the 5250 host:

    • pcsws.exe 5250 10.134.54.46 23 /n

    OR

    • pcsws.exe iSeries 10.134.54.46 23 /n

    To connect using the 3270 host:

    • pcsws.exe 3270 10.134.71.156 23 /n

    OR

    • pcsws.exe zSeries 10.134.71.156 23 /n

    To connect using the ASCII host:

    • pcsws.exe ASCII 10.134.54.46 23 /n

    Note:
    • To successfully launch a session from the command line, all four parameters must be entered correctly. Any incorrect value will result in a PCSWS047 error.

    • If any of the required parameters are omitted, the session will fail to launch successfully.

    • The host type parameter is case-insensitive, so variations such as "iSeries," "ISERIES," or "iseries" are all valid.

    • The /n command-line option is used to create a new session. It should not be combined with options intended for launching existing sessions.

    • This feature is supported only for non-secure sessions.

    PCSWS047: Invalid Command Line Argument

    This error occurs when incorrect or invalid parameters are provided in the command line while launching the HCL Z and I Emulator for Windows session.

    Usage: pcsws.exe <host_type> <hostname> <port> </n>

    Note: Port must be an integer within the range 1-65535.