title: How to get the list of filenames in a directory and store that in a variable using cmd commands
body: <p>I need to get all the filenames in a directory and store them in some variable from a command line.</p>
  
  <p>I came across this</p>
  
  <pre><code>`dir /s /b &gt; print.txt`
  </code></pre>
  
  <p>but this prints the file names to a txt file.</p>
  
  <p>How can I store these names in a variable?</p>