|
-
Jan 9th, 2000, 09:50 PM
#1
Thread Starter
Junior Member
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.
-
Jan 9th, 2000, 10:56 PM
#2
Frenzied Member
use filecopy and loop through a list (or array) of files you want to copy
-
Jan 9th, 2000, 11:54 PM
#3
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]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|