<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Unless I’m reading it wrong, you’re missing a backslash in the path that you’re constructing to the ogr2ogr binary.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#00002B'>ProgramName :=<o:p></o:p></span></p><p class=MsoNormal><span style='color:#00002B'> '"'+s+'\Quantum GIS Wroclaw\bin'+<o:p></o:p></span></p><p class=MsoNormal><span style='color:#00002B'>'ogr2ogr"<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I think there should be a slash after the “bin”?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> delphi-bounces@listserver.123.net.nz [mailto:delphi-bounces@listserver.123.net.nz] <b>On Behalf Of </b>Bob Pawley<br><b>Sent:</b> Monday, 13 February 2012 6:54 a.m.<br><b>To:</b> DUG<br><b>Subject:</b> [DUG] Shell Execute<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><div><p class=MsoNormal><span style='color:#00002B'>Hi <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>I’m having a further problem with shell execute. There seems to be a dearth of information on the web other than a simple “open” procedure.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>The following two part code performs well when I copy and paste it into command prompt.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>However when I use it in shell execute there is a problem getting both parts to run together.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>In shell execute each part of the code does its thing when the other part is commented out.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>I have tried joining the two parts with the ogr2ogr command &&, and as it appears below. I have also removed the second path to ogr2ogr with no joy.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>I either get “unable to run” or the second part of the code is recognized with the first part being ignored.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>The following is my command prompt code – which works as shown<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>set PGCLIENTENCODING=LATIN1&&set DXF_ENCODING=LATIN1&&set DXF_INLINE_BLOCKS=FALSE&&set DXF_MERGE_BLOCK_GEOMETRIES=FALSE&&ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=*** password=*****" Water2000.dxf -lco DIM=2 -nlt GEOMETRY -sql "select layer, linetype, subclasses, ogr_style, blockname, blockangle, blockscale, text from entities" -append -update -skipfailures <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>set PGCLIENTENCODING=LATIN1&&set DXF_ENCODING=LATIN1&&set DXF_INLINE_BLOCKS=FALSE&&set DXF_MERGE_BLOCK_GEOMETRIES=FALSE&&ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=*** password=****" Water2000.dxf -lco DIM=2 -nlt GEOMETRY -append -update -skipfailures -sql "select layer, linetype, subclasses, ogr_style, blockname, text from blocks" <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>Here is the shell execute code which is giving me a challenge -<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>ProgramName :=<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> '"'+s+'\Quantum GIS Wroclaw\bin'+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>'ogr2ogr" "-f" '+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>'"PostgreSQL";'+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>' PG:"host='+DBHost+' user=postgres dbname='+DBName+' password='+Pass+'" "'+ DXFfile +'" '+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>' --config DXF_INLINE_BLOCKS FALSE --config DXF_MERGE_BLOCK_GEOMETRIES FALSE --config DXF_ENCODING=UTF8 '+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>' -lco DIM=2 -nlt GEOMETRY -overwrite -skipfailures'+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>' -sql "select layer, linetype, subclasses, ogr_style, blockname, blockangle, blockscale, text from entities"'+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> '"'+s+'\Quantum GIS Wroclaw\bin'+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>'ogr2ogr""-f"'+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>' "PostgreSQL";'+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>'PG:"host='+DBHost+' user=postgres dbname='+DBName+' password='+Pass+'" "'+ DXFfile +'" '+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>' --config DXF_INLINE_BLOCKS FALSE --config DXF_MERGE_BLOCK_GEOMETRIES FALSE --config DXF_ENCODING=UTF8 '+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>' -lco DIM=2 -nlt GEOMETRY -overwrite -skipfailures'+<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>' -sql "select layer, linetype, subclasses, ogr_style, blockname, text from blocks"';<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>Thanks in advance for any suggestions.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#00002B'>Bob<o:p></o:p></span></p></div></div></div></div></body></html>