-
Please could someone help
I want my program to be able to copy Multiple files from one directory to another.
E.G "copy c:\test\*.txt c:\test2\"
However, I cannot seem to find a command to fulfil this task. I know about "Filecopy" in VB, but that only allows one file at a time copying. I even tried shelling to copy, but it just doesnt do anything.
E.G b=shell("copy "+param1+" "+param2)
I am using VB5(SP3). Please could someone help.
Cheers
M.
-
use filecopy and loop through a list (or array) of files you want to copy
-
You can also use the FileSystemObject which means you'd have to include the Scripting Runtime DLL with your App, ie.
Code:
Private Sub Command1_Click()
Dim oFSO As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")
Call oFSO.copyfile("C:\Test\*.txt", "C:\Test2")
Set oFSO = Nothing
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]