On 2007-04-21, Chris Sutcliffe <[EMAIL PROTECTED]> wrote:
>  Hey All,
> 
>  I'm having an issue with spaces in the makeprg command.  When setting it to:
> 
>  :setlocal mp=C:\Program\ Files\NSIS\makensis.exe
> 
>  I get an error:
> 
>  shell returned 1
>  (1 of 2): 'C:\Program' is not recognized as an internal or external command
> 
>  Can someone please let me know how I go about getting this to work?

Here's one way to quote/escape it:

    :setlocal mp=\"C:\\Program\ Files\\NSIS\\makensis.exe\"

The command name seen by cmd.exe needs to look like this:

    "C:\Program Files\NSIS\makensis.exe"

Windows doesn't recognize the backslash as an escape character, so 
the only way that I know of to execute a command containing a space 
in its path name is to enclose the path name in double quotes.

You can't quote the rhs of a set or setlocal command--you can only 
backslash-escape problematic characters such as backslashes, spaces 
and double quotes.  Hence the backslashes in the solution above.

HTH,
Gary

-- 
Gary Johnson                 | Agilent Technologies
[EMAIL PROTECTED]     | Mobile Broadband Division
                             | Spokane, Washington, USA

Reply via email to