title: Creating "Memory" In Batch Files
body: <p>I'm not sure how to word my question here. But for example, say I have a batch file with:</p>
  
  <pre><code>@echo off
  
  echo test &gt; text.txt
  set example_var=&lt;text.txt
  </code></pre>
  
  <p>I know that this specific piece of code is redundant since you could just set "example_var" equal to "test", but my question is how can I create "memory" (as in data that the text document holds) inside of the batch?</p>
  
  <p>Something like this:</p>
  
  <pre><code>@echo off
  
  echo test 0&gt;&amp;1
  set example_var=&lt;&amp;1
  </code></pre>
  
  <p>Basically I just want to avoid creating temporary text documents to hold information. I am sure I found an example on this website before but I couldn't find it.</p>
  
  <p>EDIT:</p>
  
  <p>So this is the situation:</p>
  
  <pre><code>(%systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe .\Code.ps1) | find "::/kl" | set /p code
  </code></pre>
  
  <p>I want the output of <code>%systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe .\Code.ps1</code> and <code>find "::/kl"</code> to be the input for <code>set /p code</code>, ultimately setting a string of text to be put into the variable <code>code.</code></p>