@echo off

set COPYCMD=/Y

if exist c:\apmlog.log goto WRAP

VER > osver.txt
jfind16 osver.txt "Windows 95"
if errorlevel 10 GOTO MEMPHIS
GOTO WIN95

:WIN95
cls
echo Launching APMTEST for Windows 95
copy apmtest.95 apmtest.exe /y
start apmtest.exe /L c:\apmlog.log
GOTO END

:MEMPHIS
cls
echo Launching APMTEST for Memphis
copy apmtest.mem apmtest.exe /y
start apmtest.exe /L c:\apmlog.log
GOTO END

:WRAP
VER > osver.txt
jfind16 osver.txt "Windows 95"
if errorlevel 10 GOTO MEMPHISWRAP
GOTO WIN95WRAP

:MEMPHISWRAP
move c:\apmlog.log .\apmlog.log
goto END

:WIN95WRAP
move c:\apmlog.log .\apmlog.log
jfind16 apmlog.log "Error: "
if errorlevel 10 GOTO FAIL
jfind16 apmlog.log "(Filtered Out) "
if errorlevel 10 GOTO FAIL

GOTO PASS

:PASS
echo NTLOG REPORT ------------------------------------------------------- >> apmlog.log
echo Tests Total           1       Variations Total           1 >> apmlog.log
echo ------------------------------------------------------------------ >> apmlog.log
echo Tests Passed          1 100%%  Variations Passed          1 100%% >> apmlog.log
GOTO END

:FAIL
echo NTLOG REPORT ------------------------------------------------------- >> apmlog.log
echo Tests Total           1       Variations Total           1 >> apmlog.log
echo ------------------------------------------------------------------ >> apmlog.log
echo Tests Passed          0   0%%  Variations Passed          0   0%% >> apmlog.log


:END

cls
