On Jan 6, 2008 2:14 PM, JJ <jjnoakes / gmail.com> wrote:

>   exec("C:\\Program Files\\Anything\\Foo.exe");

Works just fine for me without the semicolon.

>
> Since this is a one-argument call to Kernel::exec, Ruby passes it to
> the command interpreter, which tries to split the single argument on
> shell meta-characters as it would for "echo *" or "ls -al". However,
> "C:\\Program" is not the executable that we desire.
>
> In Perl, one can force the no-shell-interpreter path by calling exec
> (and system) like so:
>
>   my $cmd = "C:\\Program Files\\...";
>   exec( { $cmd } $cmd );
>
> Is there any such option in Ruby?
>
> -JJ

I might not be understanding your situation, but on my windows system,
this works fine...

irb> s = "c:\\program files\\adobe\\acrobat 7.0\\reader\\acrord32.exe"
=> "c:\\program files\\adobe\\acrobat 7.0\\reader\\acrord32.exe"
irb> `#{s}`
=> ""

exec s also works but the irb process closes after that.

Todd