jd.smithuk
08-02-2017, 12:57 PM
Hi I have a directory with a number of txt files in eg A1.txt A2.txt Ae.txt I want to copy them all to a different directory and combine them in a single file
Set fso = CreateObject("Scripting.FileSystemObject")
From_File = "C:\temp\*.*"
To_File = "C:\fred.txt"
fso.CopyFile From_File, To_File, True
However when I run the above I get a file path error if I change to_File C:\ it copies the individual files perfectly.
Does copyfile not allow you to copy as per dos?
Thanks
John
Set fso = CreateObject("Scripting.FileSystemObject")
From_File = "C:\temp\*.*"
To_File = "C:\fred.txt"
fso.CopyFile From_File, To_File, True
However when I run the above I get a file path error if I change to_File C:\ it copies the individual files perfectly.
Does copyfile not allow you to copy as per dos?
Thanks
John