Getting XCOPY to concatenate (append)

2019-05-17 16:36发布

问题:

It it actually possible to get XCOPY to append, as per

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true To append files, specify a single file for destination, but multiple files for source (that is, by using wildcards or file1+file2+file3 format).

?

Neither wildcards or file1+file2+file3 format works for me.

Workaround (sometimes): Use COPY instead.

回答1:

If I get it right, you want to merge files into one. For text files I would use:

FOR /R %%f in (file*) DO TYPE %%f >> bigfile


标签: windows-7 cmd