@echo off
setlocal
%~d0
cd %~dp0
set MICS_HOME=%~dp0
set MICS_HOME=%MICS_HOME:~0,-1%

if not exist "%MICS_HOME%\bis" goto UPDATE
echo starting MICS, please wait...
start "mics" "%MICS_HOME%\jre\bin\javaw.exe" -Xmx768m -splash:mics_splash.png -jar "%MICS_HOME%\mics.jar" -ui -standalone %* 
goto END
:UPDATE 
echo MICS is not configured, running "%MICS_HOME%\micsupdate.bat"
"%MICS_HOME%\micsupdate.bat" %*
:END
endlocal