@echo off
if not exist %0\cdgames.exe goto default
%0\cdgames PROPER %1
goto postcdgp
:default
if not exist \origin\cdgames.exe echo Please run ORIGIN from the CD-ROM drive
:direct
if not exist \origin\cdgames.exe goto exit
\origin\cdgames PROPER %1
:postcdgp
if errorlevel 4 goto spawned
if errorlevel 3 goto error
if errorlevel 2 goto tasked
if errorlevel 1 goto exit
:spawned
pause
goto direct
:tasked
if not exist task.bat echo ERROR -- Unable to establish current task
if not exist task.bat goto exit
call task
goto direct
:error
echo Fatal Error
pause
:exit
cd \
