title: VBS: oShell.run and robocopy not working
body: <p>I'm trying to mirror a share to a local computer using VBS and robocopy. The script works, but the folder from the share has spaces in the path and I can't get it to work with a path with spaces.</p>
  
  <pre><code>InputFile = "\\baardrob\Software application\Scripts\Input\computers.Txt"
  Const OverWriteFiles = True
  Set oShell = WScript.CreateObject("WSCript.shell")
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.OpenTextFile(InputFile)
  Set myLog = objFSO.OpenTextFile("\\baardrob\Software application\Scripts\Input\failed.txt", 2)
  Do Until objFile.AtEndOfStream
    strComputer = objFile.ReadLine
    On Error Resume Next
    oShell.run "robocopy "\\baardrob\software application" c:\temps /mir"  
    If Err Then myLog.WriteLine strComputer
    On Error Goto 0
  Loop
  myLog.Close
  
  MsgBox "Done"
  </code></pre>
  
  <p>EDIT: 
  Ekkehard.Horner solution worked, I have another problem though. c:\temps was just a attempt to get it work, it should actually be writing to "\" &amp; strComputer  "\c$", but this doesn't work.</p>
  
  <p>I allready tried:</p>
  
  <pre><code>InputFile = "\\baardrob\Software application\Scripts\Input\computers.Txt"
  Const OverWriteFiles = True
  Set oShell = WScript.CreateObject("WSCript.shell")
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.OpenTextFile(InputFile)
  Set myLog = objFSO.OpenTextFile("\\baardrob\Software application\Scripts\Input\failed.txt", 2)
  Do Until objFile.AtEndOfStream
    strComputer = objFile.ReadLine
    On Error Resume Next
    oShell.run "robocopy ""\\baardrob\Software application""  ""\\"" &amp; strComputer &amp; ""\c$"" /mir" 
    If Err Then myLog.WriteLine strComputer
    On Error Goto 0
  Loop
  myLog.Close
  
  MsgBox "Done"
  </code></pre>