views:

38

answers:

3

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 :)

A: 

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

copy file*.txt e:\destination
ghostdog74
no, i need to pick up specific folders from a directory
sushant
+1  A: 

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\

Andrew
i dont know how to use it. can u plz give the exact syntax? that would be really helpful
sushant
this *is* the answer. The for command iterates through the list of files (specified in brackets) and executes the command that appears after the "do" keyword. Try typing `for /?` on the command line for more information
Andrew
yeah its working. thanks a lot
sushant
A: 

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

Midhat
got it. thanks a lot
sushant