title: Merge two Batch Files into one
body: <p>i have written a small script that is taking infos from an console application and sending it via email to me. I have used Quiet to let the programm run in the background. </p>
  
  <p>start.bat</p>
  
  <pre><code>Quiet script.bat
  </code></pre>
  
  <p>script.bat</p>
  
  <pre><code>info.exe &gt; "data.txt"
  sendEmail -o tls=yes -f myemail@gmail.com -t myemail@gmail.com -s smtp.gmail.com:587 -xu myemail@gmail.com -xp mypasswd -u "XXX" -m "XXX" -a "data.txt" 
  del "data.txt"
  </code></pre>
  
  <p>if i run it like this it works fine but when i try to make one file of it like:</p>
  
  <p>script.bat</p>
  
  <pre><code>Quiet script.bat
  info.exe &gt; "data.txt"
  sendEmail -o tls=yes -f myemail@gmail.com -t myemail@gmail.com -s smtp.gmail.com:587 -xu myemail@gmail.com -xp mypasswd -u "XXX" -m "XXX" -a      data.txt" 
  del "data.txt"
  </code></pre>
  
  <p>It sends infinte amount of emails. When i make it like this it works but not like i want it to.</p>
  
  <p>script.bat</p>
  
  <pre><code>Quiet script.bat
  pause
  info.exe &gt; "data.txt"
  sendEmail -o tls=yes -f myemail@gmail.com -t myemail@gmail.com -s smtp.gmail.com:587 -xu myemail@gmail.com -xp mypasswd -u "XXX" -m "XXX" -a      data.txt" 
  pause
  del "data.txt"
  </code></pre>