title: wait for a file to be created
body: <p>I have written a program in vbs and it should do the following. First of all it executes a program that I wrote in C++. At the end of that program a file is created. So I want my vbs script to wait until that program has finished and I tried to use this to wait for the file to be created.</p>
  
  <pre><code>Set fso = CreateObject("Scripting.FileSystemObject")
  While (Not(fso.FileExists("D:\dev\FF\temp.asm")))
  Wend
  </code></pre>
  
  <p>Once this has happened it should execute a following program.</p>
  
  <p>Now I noticed that it is not really working so I am not sure if the loop was set up correctly.
  Could anyone tell me how to wait for a file to be created correctly?</p>
  
  <p>EDIT: Right now I am using this code:</p>
  
  <pre><code>folder="D:/dev/FF"
  x=inputbox("name of your file (no extension)")
  
  Set a = WScript.CreateObject("WScript.Shell") 
  Return = a.Run("frankifier2 "&amp;folder&amp;" "&amp;x&amp;".ff", 1, true)
  </code></pre>
  
  <p>And I am getting following error:</p>
  
  <blockquote>
    <p>Line: 5<br>
    Char: 1<br>
    Error: Unable to wait for process.<br>
    Code: 80020009<br>
    Source: WshShell.Run  </p>
  </blockquote>