Batch - Store output of dir command into variable - directory listing
<p>I need to store an entire directory listing into a variable, then pass said variable as a parameter to another script. Either directly or by first storing the output of dir to a text file, then doing something like this :</p>

<pre><code>dir \path\todir &gt; temp.txt
set /p VAR=&lt;temp.txt
</code></pre>

<p>But the above only reads one line. Can someone help? </p>