DOS COMMAND: COPY FILE1+FILE2, FILE3

J

jacveld

Is it possible to use the DOS command:

F:\>copy "F:\Adres_voorloop.txt" + "F:\adres.txt",
"F:\adres_compleet.txt"

within VBA and Word 2003 ??

FileSystemObject.CopyFile does NOT work

Can SHELL give the solution ??

Hope to hear,

Regards

JACVELD
 
J

jacveld

Shell ("F:\adres.bat") did the trick

contents of F:\adres.bat:

COPY "F:\Adres_voorloop.txt" + "F:\adres.txt","F:\adres_compleet.txt"

Thanks anyway

JACVELD
 
K

Karl E. Peterson

jacveld said:
Is it possible to use the DOS command:

F:\>copy "F:\Adres_voorloop.txt" + "F:\adres.txt",
"F:\adres_compleet.txt"

within VBA and Word 2003 ??

FileSystemObject.CopyFile does NOT work

Can SHELL give the solution ??

I saw you used a batch file to solve your immediate problem, but in answer
to your question, Yes, you can use Shell to run internal command processor
commands or use redirection. You need to invoke a secondary copy, like
this:

MyCmd = "copy file1+file2 file3 /b"
Call Shell(Environ$("comspec") & " /k " & MyCmd)

The /k will keep the window open. When you have it working, change that to
/c.

Later... Karl
 
Top