title: Dos batch copy all files except one not working
body: <p>Following</p>
  
  <p><a href="https://stackoverflow.com/questions/4098444/move-all-files-except-some-file-pattern-from-a-dos-command">Move all files except some (file pattern) from a DOS command</a></p>
  
  <p>I want to copy all files from my release dir to the deployment dir with that batch file:</p>
  
  <pre><code>echo off
  
  set "source=.\EasyRun\bin\Release\"
  set "destination=C:\temp\EasyRun\"
  
  IF exist %destination%  rd %destination% /s /Q
  
  IF exist %source% ( echo "OK release") ELSE ( echo "NO Realease DIR "%source% &amp;&amp; pause &amp;&amp; exit )
  
  dir /b /a-d %source%|findstr /b "vshost" &gt; excludeList.txt
  xcopy /s %source%"*.exe" %destination% /exclude:excludeList.txt
  xcopy /s %source%"*.dll" %destination%
  
  echo "OK!!"
  Pause
  </code></pre>
  
  <p>So here are two problems:</p>
  
  <ol>
  <li>the excludeList is not filled and the file is empty</li>
  <li>even when manually I put .\EasyRun\bin\Release*.vshost.exe it the xcopy doesn't exclude it from copying.</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/tZ1Xi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tZ1Xi.png" alt="enter image description here"></a></p>
  
  <p>thanks</p>