Sorry, I hit the wrong key, and it got sent. I'll finish my e-mail below.<br><br><div><span class="gmail_quote">On 9/25/07, <b class="gmail_sendername">Tim Wilson</b> <<a href="mailto:tim_linux@wilson-home.com">tim_linux@wilson-home.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I ran across a problem today, that I thought some of you might enjoy. A customer was running a product we talk to in a directory like "C:\Program Files\Foo Bar\Foo2". In this directory, my app runs a batch file. The easiest way to execute the batch file from a C program is to call system(), right? That's great, except it has a problem with spaces. No problem, I'll put escaped double quotes around the argument to system(). That too, did not work. After doing some Googling, I found something that sounds like others are experiencing the same problem (someone created a bug
at codehaus for jruby).</blockquote><div><br>Talking around the office, Chris F suggested (as a joke), to specify it as an environment variable. Guess what? It worked. So if I want to continue to allow customers to put the other product in a path with spaces in it, I'll have to do a putenv() first, and then reference the environment variable in the system() call. Nice work Microsoft!
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">-- <br><span class="sg">Tim
</span></blockquote></div><br><br clear="all"><br>-- <br>Tim