title: Redirecting output from a batch file, INCLUDING the commands
body: <p>I have a batch file that executes a series of commands. As each one executes, it returns either a "success" or "fail" message. Its simple enough to redirect the output from each of these using the >> and send it to a file, but without the associated command the output is useless.</p>
  
  <p>(Batch File)</p>
  
  <pre><code>Command "D21" &gt;&gt; Myfile.txt
  Command "D22" &gt;&gt; Myfile.txt
  Command "D23" &gt;&gt; Myfile.txt
  Command "D24" &gt;&gt; Myfile.txt
  </code></pre>
  
  <p>(Output file: Myfile.txt)</p>
  
  <pre><code>Fail
  Succeed
  Fail
  Succeed
  </code></pre>
  
  <p>What I would like to do is also send the command that was executed to that file so it might look like this...</p>
  
  <p>(Desired output file: Myfile.txt)</p>
  
  <pre><code>Command "D21" Fail
  Command "D22" Fail
  Command "D23" Succeed
  Command "D24" Succeed
  </code></pre>
  
  <p>Any thoughts on how I could accomplish this with a minimum of effort?</p>