title: looping through two directories using batch script
body: <p>I want to loop though two directories A and B and where files with same names exist. And once I get path to both of the same name files I want to do some operation. Here is my batch script :</p>
  
  <pre><code>setlocal ENABLEDELAYEDEXPANSION 
  for /r "A" %%o in (*.c,*.cpp,*.h) do (
  for /r "B" %%l in (*.c,*.cpp,*.h) do (      
              set x = %%~nxo
              set y = %%~nxl
              if %x% == %y% ( echo %x% )
      )
  )
  endlocal
  </code></pre>
  
  <p>Here I am trying to print the names of the files but unable to do so. 
  I am getting an error : echo was unexpected at this time.
  So what is the problem with this script.</p>