继
Move all files except some (file pattern) from a DOS command
我想将发布目录中的所有文件复制到该批处理文件的部署目录:
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
所以这里有两个问题:
答案 0 :(得分:0)
可能是由空的excludeList.txt引起的。 - >尝试输入虚拟条目
我在xcopy和网络共享方面遇到了一些问题。 (由于延迟,访问限制,我收到了错误......)
我建议使用/ xf选项进行robocopy。例如/ xf vshost 此外,/ MT [:N]多线程副本应加快复制过程。