title: Redirect command as well as output to text file in Windows CLI?
body: <p>I need to redirect both the command as well as its output to a text file in Windows CLI. For instance, I am running the <code>nslookup</code> command on a subnet using a <code>FOR</code> loop,</p>
  
  <pre><code>for /L %i IN (1,1,254) DO nslookup 192.168.1.%i &gt;&gt; nslookup.txt
  </code></pre>
  
  <p>However, this only redirects the output of the command.</p>
  
  <p>Is there a way to redirect both the command as well as the output to a text file? Please do not tell me about clip and select all/copy commands.</p>