@echo off

if not exist $A\$TBCOM.exe goto NOFILES
if not exist $A\rcdos.exe goto NOFILES
if not exist $A\cmdos.exe goto NOFILES

rem   --- Uninstall existing TSRs ---
$A\rcdos.exe /u /q
$A\cmdos.exe /u /q
$A\$TBCOM.exe /u /q

rem   --- Load the communications ---
$A\$TBCOM.exe /l /p$NS
if not errorlevel 0 goto UNINST

rem   --- Load DOS communications manager ---
$A\cmdos.exe /l /p$NS
if not errorlevel 0 goto UNINST

rem   --- Load Remote Control ---
$A\rcdos.exe /l /p$NS
if not errorlevel 0 goto UNINST

goto END

:NOFILES
echo Cannot be a LapLink DOS Remote Control Host because one (or more) files 
echo are missing.  You may wish to run the LapLink for Windows Setup program 
echo again to install the missing files.  This does not affect your ability 
echo to host a Windows Remote Control session.  
goto END

rem   --- Uninstall existing TSRs ---

:UNINST
$A\rcdos.exe /u
$A\cmdos.exe /u 
$A\$TBCOM.exe /u

:END
echo on
