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

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
 
H

HKSHK

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
 
H

Hexman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top