Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
Combine Two Files (Concatenate)
From Wiki
You can combine two or more files by reading in the files and then writing out to a combined file using the FileSystemObject, or you can use DOS.
- Set oWSH = CreateObject("WScript.Shell")
- oWSH.Run ("%comspec% /c copy c:\docs\test1.txt+c:\docs\test2.txt c:\docs\test3.txt")
An Explanation
If test1.txt is:
abc 'no return character
... and test2.txt is:
def
... test3.txt will be:
abcdef 'eof
If test1.txt is:
abc 'with a return character
... test3.txt will be:
abc
def 'eof
"ComSpec (or %COMSPEC% ) is one of the environment variables used in MS-DOS and Microsoft Windows, which normally points to the command line interpreter, ..." (http://en.wikipedia.org/wiki/ComSpec)
Further Information
DOS Copy: http://www.easydos.com/copy.html



LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.