Saturday, August 28, 2010

Re: Run program with spaces in path

On Sat, Aug 28, 2010 at 1:23 PM, Jakson A. Aquino
<jaksonaquino@gmail.com> wrote:
> Hi!
>
> How can a Vim script run a program which has spaces in its path? For
> example, the following "system" command fails with the message
> "'C:\Program' is not recognized as an internal or external command,
> operable program or batch file":
>
> let rcmd = '"C:\Program files\R\R-2.11.1\bin\Rcmd.exe" BATCH "example.R"'
> let rlog = system(rcmd)
>  if v:shell_error
>   echomsg rlog
> endif

I solved the problem with the following workaround:

if !exists("g:vimrplugin_rpathadded")
let $PATH = b:rinstallpath . '\bin;' . $PATH
let g:vimrplugin_rpathadded = 1
endif

May be this solution will be useful for someone else in the future...

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: