@ECHO OFF
IF NOT EXIST ..\CONFIG.BAT (
  ECHO ERROR:  CANNOT FIND CONFIG.BAT FILE. > SETUP_SIM.LOG
  ECHO CANNOT FIND CONFIG.BAT FILE.
  ECHO THE CURRENT DIRECTORY NEEDS TO BE SET TO THE DIRECTORY THIS BATCH FILE IS IN BEFORE RUNNING THIS BATCH FILE
  PAUSE
  ECHO DONE > DONE_SETUP_SIM.LOG
) ELSE (
  IF EXIST DONE_SETUP_SIM.LOG DEL *SETUP_SIM*.LOG
  ..\CONFIG.BAT > ..\CONFIG.SQL
  ECHO ON
  %SQLPLUS_PATH%SQLPLUS.EXE /NOLOG @SETUP_SIM
  :WAIT1
  IF NOT EXIST DONE_SETUP_SIM.LOG GOTO WAIT1
  @ECHO OFF
  ECHO -------------------
  ECHO SIM SETUP COMPLETE. 
  ECHO -------------------
  ECHO PLEASE VIEW THE LOG FILES TO CHECK FOR ANY ERRORS. 
  DEL ..\CONFIG.SQL
)
REM NOTHING BEYOND THIS POINT WILL RUN