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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need FileCopy with wildcards

Status
Not open for further replies.

Dylan

MIS
Aug 27, 1998
109
US
I need code to copy multiple file *.txt from foldera to folderb.

Is there a way to do this. Filecopy does not appear to support wildcards.

Thanks in Advance ...

Tom

Tom Moran
Lansing, Michigan
 
If you set a reference to Microsoft Scripting Runtime, you can create a FileSystemOject that exposes drives, folders and files collections you can spin.

Sorry, all I have time to do is point you. If you need more help post again and we'll try to help.

Good Luck!

Have a great day!

j2consulting@yahoo.com
 
Try a Shell Command using something like xcopy

shell "xcopy C:\foldera\*.txt C:\folderb\ /h"

This is equivalent to the start menu/run command box. If you need more help on xcopy start a command prompt window and type xcopy /?

If you don't want to do this then try a loop on the DIR function (see the dir function example in access vba help) in foldera and use filecopy for anything that ends in .txt
hth
Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top