title: VBS How to call cmd.exe using a string variable with spaces
body: <p>I need to call the following:</p>
  
  <pre><code>set WshShell = WScript.CreateObject("WScript.Shell")
  WshShell.Run "cmd /c copy /y C:\input\" &amp; WScript.Arguments(0) &amp; " C:\output", 0
  </code></pre>
  
  <p>where the input argument may be "File Name.txt". I have seen countless examples of people doing the same thing using double quotes for a hard coded file location, but nothing using an input argument or variable. What syntax is required so that the command line receives:</p>
  
  <pre><code>copy /y "C:\input\File Name.txt" C:\output
  </code></pre>
  
  <p>and not</p>
  
  <pre><code>copy /y C:\input\File Name.txt C:\output
  </code></pre>
  
  <p>for an arbitrary file name?</p>