title: VB.NET to create and run batch file issues
body: <p>Here is the code i am running, and currently having issues with.</p>
  
  <pre><code>Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
      Dim path As String
      Dim sb As New System.Text.StringBuilder
      Dim sb1 As New System.Text.StringBuilder
      Dim Project As String = txtProject.Text
      Dim Building As String = txtBuilding.Text
  
      'Get the building and project number from some form of user input. They're predefined here:
      Building = "A1"
      Project = "10"
  
      If (folderDlg.ShowDialog() = DialogResult.OK) Then
          path = folderDlg.SelectedPath
          Dim root As Environment.SpecialFolder = folderDlg.RootFolder
      Else
          Return
      End If
  
      Me.Visible = False
  
      sb.AppendLine("")
      sb.AppendLine("_.``")
      sb.AppendLine(Building)
      sb.AppendLine(Project)
      sb.AppendLine("ZOOM")
      sb.AppendLine("e")
      sb.AppendLine("_.qsave")
      sb.AppendLine("_.quit")
  
      IO.File.WriteAllText(path &amp; "\TB Edit.scr", sb.ToString())
  
      sb1.AppendLine("FOR %%D IN (*.DWG) DO " &amp; Chr(34) &amp; "C:\Program Files\Autodesk\Acade 2013\acad.exe" &amp; Chr(34) &amp; " %%D /B " &amp; Chr(34) &amp; path &amp; "\TB Edit.scr" &amp; Chr(34))
      sb1.AppendLine("Pause")
      sb1.AppendLine("END")
  
      IO.File.WriteAllText(path &amp; "\TB Edit.bat", sb1.ToString())
  
      Process.Start(path &amp; "\TB Edit.bat")
  
      My.Computer.FileSystem.DeleteFile(path &amp; "\TB Edit.bat")
      My.Computer.FileSystem.DeleteFile(path &amp; "\TB Edit.scr")
  </code></pre>
  
  <p>When the batch file runs, this is what i get...
  'Added the pause to see what's going on-</p>
  
  <pre><code>C:\Users\Owner\Dropbox\CADMASTER TECH  - SOUTH VALLEY\THOMAS\VB Programs\Title B
  lock Edit\Title Block Edit\bin\Release&gt;FOR %D IN (*.DWG) DO "C:\Program Files\Au
  todesk\Acade 2013\acad.exe" %D /B "C:\Users\Owner\Desktop\TB Edit.scr"
  
  C:\Users\Owner\Dropbox\CADMASTER TECH  - SOUTH VALLEY\THOMAS\VB Programs\Title B
  lock Edit\Title Block Edit\bin\Release&gt;Pause
  Press any key to continue . . .
  </code></pre>
  
  <p>But when i don't delete the batch file at the end of the program, and go to it's location and run it, it runs just fine, like it should!</p>
  
  <p>Been messing with this for about two days now... Any ideas?</p>