How do I copy all text files into one??? eg; Shell("copy c:\CND\dr*.txt C:\CND\TestC.txx")

  • Thread starter Thread starter Hexman
  • Start date Start date
H

Hexman

Hello All,

I receive many files with similar content each day. All I want to do is copy them into one file, then I'll use that file for my processes. Using
vb2005. I've tried:

Shell("copy c:\CND\dr*.txt C:\CND\TestC.txx")

That comes back with "File not found". There are files there!

Tried:

File.Copy("c:\CND\dr*.txt", "C:\CND\TestC.txx", True)

That failed also.

I've run the Shell command line from the command line in xp and it works as expected. What am I doing wrong???

Thanks,

Hexman
 
Hello Hexman,

The "File not found" messages is not related to your text files, but to
"copy" (there is no copy.com or copy.exe; it's in internal Command from
Command.com).

You should use this line instead:
Shell ("cmd /C copy C:\CND\dr*.txt C:\CND\TestC.txx")

Best Regards,

HKSHK
 
Works Great. Thanks for the education!!

Hexman

Hello Hexman,

The "File not found" messages is not related to your text files, but to
"copy" (there is no copy.com or copy.exe; it's in internal Command from
Command.com).

You should use this line instead:
Shell ("cmd /C copy C:\CND\dr*.txt C:\CND\TestC.txx")

Best Regards,

HKSHK
 
Back
Top