Home All Groups Group Topic Archive Search About

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

Author
31 Jul 2006 9:08 PM
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

Author
1 Aug 2006 6:48 AM
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

Hexman wrote:
Show quoteHide quote
> 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
Author
1 Aug 2006 8:09 AM
Hexman
Works Great.  Thanks for the education!!

Hexman

On Tue, 01 Aug 2006 08:48:03 +0200, HKSHK <hk***@gmx.net> wrote:

Show quoteHide quote
>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
>
>Hexman wrote:
>> 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