title: Why isn't this xcopy command not working?
body: <p>I am trying to run a simple xcopy batch script but I am facing some difficoulties.
  Here is the script</p>
  
  <pre><code>SET SRC=C:\FOLDER1\FOLDER2
  SET DEST=V:\FOLDER1
  
  FOR /D %%d in (%SRC%\*) do xcopy /S /I /y /exclude:%SRC%\exclude.txt %%d  V:\FOLDER1\%%~nxd
  </code></pre>
  
  <p>Basically this script should copy some of the subfolders of <code>C:\FOLDER1\FOLDER2</code> (excluded.txt contains a list of directories to exclude) and its content to the destination. However when I run the scripts, altough no errors are thrown, <strong>NO FILES OR FOLDERS get copied.</strong> What am I doing wrong?</p>
  
  <p>Interestingly if I run the following script INSIDE <code>FOLDER2</code>, everything procedes as expected.</p>
  
  <pre><code>FOR /D %%A in (*) DO xcopy /S /I /y /exclude:exclude.txt %%A  V:\FOLDER1\%%A
  </code></pre>