title: How to concatenate command outputs of a Windows batch file
body: <p>I'm writing a Windows batch file that will purge logs older than 90 days. How can I concatenate the outputs of the commands so that they appear in one line? I also want to append this output to a file later. My batch file so far is:</p>
  
  <pre><code>@echo off    
  time /t &amp;&amp; echo "--" &amp;&amp; date /t &amp;&amp; echo " -I- Purging " &amp;&amp; FORFILES /P "D:\Logs" /M *.log /D -90 /C "cmd /c echo @file @fdate"
  rem FORFILES that will purge the files
  </code></pre>
  
  <p>and this outputs:</p>
  
  <pre><code>12:08
  --
  14/08/2012
   -I- Purging
  
  "&lt;filename&gt;" 02/08/2012
  "&lt;filename&gt;" 30/07/2012
  </code></pre>
  
  <p>How can I concatenate these outputs? Thanks.</p>