title: How can I run a !<cmd> from a vim script when the path has a space in it on Windows?
body: <p>I'm attempting to use the <code>:!&lt;cmd&gt;</code> format in vim to execute an external command and put the results in the buffer.  If I type <code>:!</code>, path completion is possible and I can complete the path right up to the command I want to execute.  This automatically escapes spaces like so:</p>
  
  <pre><code>:!c:\Program\ Files\ (x86)\Microsoft\ Visual\ Studio\ 9.0\Common7\IDE\TF.exe
  </code></pre>
  
  <p>When I hit enter, I get:</p>
  
  <pre><code>'c:\Program\' is not recognized as an internal or external command
  </code></pre>
  
  <p>Which I suspect means that vim has not escaped the spaces properly when passing the command to cmd.exe.  I've tried all sorts of escaping combinations to make this work but to no avail.  The only way I've found to do this is to work out what the DOS8.3 filename is and use that instead of the long path name.  However, I don't like this approach since it's going to make my script less portable.  Does anyone know if this can be done, or is it a bug in vim?</p>