title: How to get the relative path for each file in a directory tree based on specified folder path?
body: <p>I want to loop recursively through a directory and get the file names with full file path and additionally with path relative to the base folder path. For example, a file located in <code>D:\foo\bar\a\b\file.txt</code> has the  relative path <code>bar\a\b\</code>.</p>
  <p>I'm using this code right now which does not work as expected:</p>
  <pre><code>FOR /R D:\Download\758_DATA\ %%F IN (*) DO (
      SET B = %%~pF
      Set B=%B:~-6%  ::take substring of the path
      ECHO.%B%
      ECHO %%F 
      ECHO.
  )
  </code></pre>