@ECHO OFF
REM
REM This batch file will set (and overwrite) some environment variables when
REM called directly from the commandline or from a batch file.
REM The environment variable ERRORLEVEL is set in in this case.
REM
REM When called using '%COMSPEC% /C RUN_JOBSERVER.BAT ...' the environment will not be changed.
REM On older Windows Systems like Windows95 and Windows98 the errorlevel cannot
REM be checked after calling this batch file in this case.  
REM

REM
REM Setup BICsuite environment
REM
CALL COMMON.BAT
IF [%ERRORLEVEL%]==[0] GOTO PAST_COMMON
SET BICSUITE_BATCH_EXITCODE=%ERRORLEVEL%
GOTO DOEXIT

:PAST_COMMON
SET BICSUITE_BATCH_EXITCODE=0
SET ERRORLEVEL=

"%BICSUITEJAVA_BS%" %BICSUITEJAVAFLAGS_BS% -cp "%BICSUITEHOME%\lib\BICsuite.jar;%BICSUITEJDBC%" de.independit.scheduler.BICServer "%BICSUITECONFIG%\server.conf"
SET BICSUITE_BATCH_EXITCODE=%ERRORLEVEL%

:DOEXIT
REM
REM Exit depending on windows version
REM
IF [%WIN_VERSION%]==[WIN_NT] EXIT /B %BICSUITE_BATCH_EXITCODE% >NUL
SET ERRORLEVEL=%BICSUITE_BATCH_EXITCODE%


