title: Batch file Looping through files in a set directory returning errors
body: <p>I'm trying to loop through and print a list of all files in a directory, the directory is being set by 2 different arguments, but I keep getting the following error</p>
  
  <p><code>The syntax of the command is incorrect</code></p>
  
  <p>I'm not really sure where im going wrong though as when i echo out the variables they are echoing correctly.</p>
  
  <p>My code is as follows;</p>
  
  <pre><code>@echo off
  
  setlocal
  
  set "parent=C:\Users\Test\script\files"
  set "addon=GROWTH"
  
  setlocal enableDelayedExpansion
  for %%X in ("%parent%\%addon%\*") do (
      echo %%~dpnX
  )
  
  endlocal
  endlocal
  </code></pre>
  
  <p>So basically, i just want it to list all the files in the <code>C:\Users\Test\script\files\GROWTH</code> directory.</p>
  
  <p>Any help would be much appreciated.</p>