Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate Files with Wildcard in VBScript

Status
Not open for further replies.

DRRAZGU

Programmer
May 21, 2002
9
0
0
US
I am writing a script to concatenate all the files with a particular extension into one. I tried something like this:

objfso.copyfile "m:\*.erg", "m:\big.txt",true
but it gives a "path not found" error

Copying the files as a group without concatenation works:
objfso.copyfile "m:\*.erg", "p:\apps\testonly",true

Using the DOS shell works:
objshell.run("cmd /c COPY M:\*.ERG M:\big.txt")
but I don't want to use it because it runs asynchronously.

How do I concatenate files in
VBScript. Am I trying the impossible?
 
because it runs asynchronously
objshell.Run "cmd /c COPY M:\*.ERG M:\big.txt", , True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That works. Thanks very much.

I would still like to know if there is a way to do the concatenation using copyfile.

Thanks again, PHV.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top