title: How do you stop a Windows Batch file from exiting early?
body: <p>I have a windows batch file that looks similar to:</p>
  
  <pre><code>C:\DoStuff.cmd
  move output.bak C:\newfolder\output.bak
  </code></pre>
  
  <p>The problem i have is that DoStuff.cmd executes a java program that once complete exits the batch run back to the command prompt. Line 2 never gets hit.</p>
  
  <p>i have tried the following instead to execute the command in a new window:</p>
  
  <pre><code>start "My program" /WAIT C:\DoStuff.cmd
  move output.bak C:\newfolder\output.bak
  </code></pre>
  
  <p>What happens with the above is that the new command window spawns the cmd file runs and exits back to a waiting command prompt and the window never closes, leaving the first command window waiting and the second doing nothing stuck after finishing step one.</p>
  
  <p>How do i execute the first command without it having control of the batch run somehow?</p>
  
  <p>many thanks in advance</p>