REM @ECHO OFF

REM Check for the existance of the executable
IF NOT EXIST fg0.exe GOTO ERROR1

REM Check to see if FG_ROOT has a value and set it if needed
IF NOT %FG_ROOT%.==. GOTO CONT1

IF EXIST fgtop SET FG_ROOT=.
IF EXIST ..\..\fgtop SET FG_ROOT=../..

:CONT1

REM Now that FG_ROOT has been set, run the program
ECHO FG_ROOT = %FG_ROOT%
fg0.exe

GOTO END

:ERROR1
ECHO Cannot find FG0.EXE
GOTO END

:END
