title: Loop through file names in a Batch Script
body: <p>I would like a batch script to all the text documents in a folder.
  This is what I have managed so far:</p>
  
  <pre><code>@ECHO off
  title Test
  set dir1=C:\Users\Family\Desktop\Example
  
  :Start
  cls
  echo 1. test loop
  echo 2. Quit
  set /p choice=I choose (1,2):
  if %choice%==1 goto test
  if %choice%==2 exit
  
  :test
  cls
  echo running loop test 
  FOR %%n in (%dir1% *.txt) DO echo %dir1%\%%n
  echo Done
  pause
  </code></pre>
  
  <p>What I would like outputted is:</p>
  
  <pre><code>running loop test
  C:\Users\Family\Desktop\Example\doc 1.txt
  C:\Users\Family\Desktop\Example\doc 2.txt
  Done
  </code></pre>
  
  <p><strong>But I Get this:</strong></p>
  
  <pre><code>running loop test
  C:\Users\Family\Desktop\Example\C:\Users\Family\Desktop\Example
  C:\Users\Family\Desktop\Example\doc 1.txt
  C:\Users\Family\Desktop\Example\doc 2.txt
  Done
  </code></pre>