@echo off
rem -------------------------------------------------------------------------
rem wrun - run monitor in the foreground
rem usage: wrun NN EMM
rem where: NN  = network { en, fd, tr }
rem        EMM = portion of memory to exclude { e:d800-dfff }
rem -------------------------------------------------------------------------

if "%1"=="en" set mon0=tr
if "%1"=="en" set mon1=fd

if "%1"=="fd" set mon0=en
if "%1"=="fd" set mon1=tr

if "%1"=="tr" set mon0=en
if "%1"=="tr" set mon1=fd

rem - check that the other monitors are not installed
call wchkmon.bat %mon0%
if errorlevel 1 goto exit

call wchkmon.bat %mon1%
if errorlevel 1 goto exit

rem - reset temporaries
set mon0=
set mon1=

rem - work in the Sniffer directory
cd \%1sniff

rem - display Madge copyright for Token-Ring-II monitor
if not "%1"=="tr" goto skip
chkstr \config\trmon.mnu "Token-Ring-II "
if not errorlevel 1 goto skip
echo.
echo     The Sniffer (R) Monitor for Token Ring incorporates Madge
echo     Fastmac software v4.55 and a Madge 16/4 Ringnode.
echo     Copyright (c) Madge Networks Ltd 1988-1993, All Rights Reserved
echo.
:skip

rem - load the monitor; need another batch file to avoid a memory
rem   fragmentation problem inherent in batch file processing
wload %1 %2

rem - back to the menu
:exit
if not "%1"=="fd" fixemm clear > nul
cd \
menu


