title: Get directory name from array in Batch
body: <p>I have a list of paths from which I want to extract folder name</p>
  <p>I wrote:</p>
  <pre><code>@echo off
  
  set paths[0]=&quot;C:\p\test1&quot; 
  set paths[1]=&quot;C:\p\test2&quot; 
  set paths[2]=&quot;C:\p\test3&quot;
  
  (for %%p in (%paths%) do (
     for %%F in (%%p) do echo Processing %%~nxF
  ))
  </code></pre>
  <p>but seems that nothing is shown.</p>
  <p>I expected to see:</p>
  <blockquote>
  <p>Processing test1</p>
  <p>Processing test2</p>
  <p>Processing test3</p>
  </blockquote>