title: redirecting a stream for the entire .bat file inside itself
body: <p>I've recently started working with .bat files, and I'm trying to redirect the output to a file.</p>
  
  <p>I've found 2 options, so far:</p>
  
  <ol>
  <li><code>echo aaa &gt; out.txt</code> - which sends the output of the single echo command to the specified file (can also be appended using <code>&gt;&gt;</code>)</li>
  <li>calling the entire file from the cmd using <code>somefile.bat &gt; out.txt</code> (which is actually similar to number 1, as it sends the output of the single command <code>somefile.bat</code> to <code>out.txt</code>)</li>
  </ol>
  
  <p>What I'm looking for is something else - I'm trying to have a line in my file that sends all the output from that point forth to the file.</p>
  
  <p>Thanks!</p>