saving multiple files through xcopy

0 votes
asked Apr 8, 2010 by sushant

i want to copy multiple files at once through xcopy. is it possible. i mean something like:
xcopy file1+file2+file3 destinationfolder
any help is appreciated :)

4 Answers

0 votes
answered Apr 8, 2010 by ghostdog74

if your files starts with a specific pattern, you can use wildcards (eg text files that starts with file)

copy file*.txt e:\destination
0 votes
answered Apr 8, 2010 by andrew

I don't think it's possible with a single xcopy, but you could use a for statement.
Something like:
for %f in (file1, file2, filen) do xcopy %f dest\

0 votes
answered Apr 8, 2010 by midhat

for %f in (file1,file2,file3) do xcopy %f destinationfolder

0 votes
answered Sep 15, 2017 by d1v3

I used the following for copying hundreds of files and filtering them by file extension. Below I am saying give me all files with the file extension .dll, .exe, or .pdf

for %f in (dll,exe,pdf) do xcopy /s /i C:\source\*.%f C:\destination
Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter