REM
REM     Copyright (c) 1992 Novell, Inc.  All Rights Reserved.
REM
REM     THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS 
REM     AND TREATIES. NO PART OF THIS WORK MAY BE USED, PRACTICED, 
REM     PERFORMED COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED, 
REM     ABRIDGED, CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED, 
REM     RECAST, TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT
REM     OF NOVELL, INC.  ANY USE OR EXPLOITATION OF THIS WORK WITHOUT 
REM     AUTHORIZATION COULD SUBJECT THE PERPETRATOR TO CRIMINAL AND CIVIL
REM     LIABILITY.
REM
ECHO OFF
REM Load TELAPI with one Telnet session
TELAPI -sn1
REM Open a session to the host kansas with hostid K1
TSU -O kansas K1
IF ERRORLEVEL 1 GOTO OPEN_ERROR
REM Attach hostid K1 to COM3
TSU -A K1 COM3
IF ERRORLEVEL 1 GOTO ATTACH_ERROR
REM Start third-party terminal emulator.
PROGRAM_NAME
REM Close the session.
TSU -C K1
IF ERRORLEVEL 1 GOTO CLOSE_ERROR
REM Unload TELAPI
TELAPI -U
GOTO EXIT
REM
:OPEN_ERROR
ECHO OPEN SESSION FAILED
GOTO EXIT
:ATTACH_ERROR
ECHO ATTACH TO COM3: SESSION FAILED
GOTO EXIT
:CLOSE_ERROR
ECHO CLOSE SESSION FAILED
:EXIT

