Importing the gdal bindings in python seems to disable setting a non-zero exit code.  Running the following batch file demonstrates the issue:<br><br>Running the following batch file demonstrates the issue:<br><br>@echo off<br>
set pycmd=python -c "from osgeo import gdal;import sys;sys.exit(1)" <br>echo %pycmd%<br>%pycmd%<br>echo ERRORLEVEL=%ERRORLEVEL%<br>echo.<br>set  pycmd=python -c "import sys;sys.exit(1)"<br>echo %pycmd%<br>
%pycmd%<br>echo ERRORLEVEL=%ERRORLEVEL%<br>echo.<br>pause<br><br>This prints out:<br>python -c "from osgeo import gdal;import sys;sys.exit(1)"<br>ERRORLEVEL=0<br><br>python -c "import sys;sys.exit(1)"<br>
ERRORLEVEL=1<br><br><div class="gmail_quote"><div><br>Tested on Windows 7 Pro and Server 2008 R2 64bit with GDAL 1.9.1 
MSVC2008 (Win32) with 32bit python 2.6.5 and GDAL 1.9.1 MSVC2008 (Win64)
 with 64bit python 2.6.6.<br><br>I couldn't find a
 ticket reporting the issue in trac. Is this a known issue? Is it worthy of a ticket? Are
 there any known workarounds?<br><br><br>Regards<br>Luke<br></div></div>