title: How do I add to beginning using text file using a .bat instead of append to end?
body: <p>I have a <strong>batch</strong> file that returns a list of data. Currently, every time I run the <strong>script</strong>, it appends the newly pulled data to the end of the text file. Is there a way that I can add the new data to the beginning of the file, rather than append it to the end? I need to it work this way because the data is pulled <em>chronologically</em>, and I'd like the text file to be sorted from most recent to oldest. </p>
  
  <pre><code>@ECHO OFF
  </code></pre>
  
  <p>REM Used to log server users stats into a text file located in the local c:\userlog directory</p>
  
  <pre><code>ECHO Terminal Server Users, %Date%, %TIME%&gt;&gt;c:\Userlogs\UserListTest.txt
  quser /server:servername&gt;&gt;C:\Userlogs\UserListTest.txt
  
  START C:\Userlogs\UserListTest.txt
  Exit
  </code></pre>
  
  <p>any help will be greatly appreciated</p>