combine multiple files into single file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, guys!

Running A2K, need to copy multiple text files to a single, new text file.
FileCopy assumes that the destination is a folder if wildcards are used for
the source, so I get an "Invalid Path" error when running the following code:

Dim fs
set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile "C:\*.txt", "C:\CombinedFile.txt"

Can anyone help with another way to do this?

Thanks,
BruceS
 
John,
Thanks for help! Took me a couple of tries to get the syntax correct when
using variables for the names, but did get it to work. (Had to manually add
quotes [Chr(34)] around the file names because they contained embedded
spaces. Apostrophes won't work there.)
BruceS
 
Back
Top