@echo off
echo Sample 1: erase and program
if exist yourproject.gpf2 goto galep5
echo missing yourproject.gpf2
goto nobatch
:galep5
start /wait GALEP5 yourproject.gpf2 /erase /console
if errorlevel 2 goto error2
if errorlevel 1 goto success1
goto nobatch
:error2
echo Action not successfull!
goto end
:success1
start /wait GALEP5 yourproject.gpf2 /prog /console
if errorlevel 2 goto error2
if errorlevel 1 goto success2
goto nobatch
:success2
echo Action successfull!
goto end
:nobatch
echo no batch job
:end
Sample 2: Blank, erase and program
@echo off
echo Sample 2: blank,erase and program
if exist yourproject.gpf2 goto galep5
echo missing yourproject.gpf2
goto nobatch
:galep32
start /wait GALEP5 yourproject.gpf2 /blank cfg /console
if errorlevel 2 goto error_blank
if errorlevel 1 goto success_blank
goto nobatch
:error_blank
start /wait GALEP5 yourproject.gpf2 /erase /console
if errorlevel 2 goto error_erase
if errorlevel 1 goto success_erase
goto nobatch
:error_erase
:error_prog
echo Action not successfull!
goto end
:success_blank
:success_erase
start /wait GALEP5 yourproject.gpf2 /prog /console
if errorlevel 2 goto error_prog
if errorlevel 1 goto success_prog
goto nobatch
:success_prog
echo Action successfull!
goto end
:nobatch
echo no batch job
:end