Following
Move all files except some (file pattern) from a DOS command
I want to copy all files from my release dir to the deployment dir with that batch file:
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% && pause && exit )
dir /b /a-d %source%|findstr /b "vshost" > excludeList.txt
xcopy /s %source%"*.exe" %destination% /exclude:excludeList.txt
xcopy /s %source%"*.dll" %destination%
echo "OK!!"
Pause
So here are two problems:
- the excludeList is not filled and the file is empty
- even when manually I put .\EasyRun\bin\Release*.vshost.exe it the xcopy doesn't exclude it from copying.
thanks