@echo off

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

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

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

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

rem   --- Load Remote Control ---
$S\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
$S\rcdos.exe /u
$S\cmdos.exe /u 
$S\$TBCOM.exe /u

:END
echo on
