<div>The easiest way to test this is whatever string you come up with copy it to the clipboard and paste in into the RUN prompt. If it doesn't run there, it won't run within your application.</div><div> </div><div>
Don't use the command prompt (for testing), as it treats spaces differently. How are you actually executing the generated command prompt?</div><div> </div><div>I have a unit that creates processes. I pass the program name as a parameter and then a stringlist for all other parameters. The method then double quotes the program name and then each of the parameters as the command line is generated. Perhaps something like this would help clean up the code<br>
<br></div><div class="gmail_quote">On Thu, Jun 23, 2011 at 8:30 AM, Bob Pawley <span dir="ltr"><<a href="mailto:rjpawley@shaw.ca">rjpawley@shaw.ca</a>></span> wrote:<br><blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">
<div dir="ltr">
<div dir="ltr">
<div style="color: rgb(0, 0, 43); font-family: "Times New Roman"; font-size: 12pt;">
<div>Hi</div>
<div> </div>
<div>I’m having trouble with using a variable in a string path.</div>
<div> </div>
<div>When I use the variable FW_Path := ‘C:\Program Files (x86)’ with two single
quotes, the following works well and ShowMessage(ProgramName); displayed the
full path .</div>
<div> </div>
<div>When I reference FW_Path to a variable X I get an error returned “Can Not
run....” The variable X is returned as C:\Program Files (x86) without
quotes. </div>
<div> </div>
<div>I attempted Quote String and got the following ‘C:\Program Files (x86) with
one single quote.</div>
<div> </div>
<div>Both cases return the same error - and in both cases
ShowMessage(ProgramName); displayed none of the path after C:\Program Files
(x86).</div>
<div> </div>
<div>Help would be appreciated.</div>
<div> </div>
<div>Bob</div>
<div> </div>
<div> FW_Path := QuoteStr(X); </div>
<div> DXF :=
openDialog1.FileName; </div>
<div> ProgramName :=FW_Path+'\FWTools2.4.7\bin\ogr2ogr "-f" "PostgreSQL"
PG:"host=192........ user=postgres dbname=E5R password=........" "'+ DXF +'"
-nln Import_Process';</div>
<div> </div>
<div>
ShowMessage(ProgramName);</div></div></div></div>
<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br></blockquote></div><br>