Copying Multiple Files (VB6)
Posted on 2003-03-17
Hi, I'm trying to copy multiple files from one location to another.
I need to copy all files with the .mdl extension to /models/ .spr to /sprites/ etc, the source folder contains .spr .mdl and .wav files.
Here's what I've got at the moment
Private Sub btnTransfer_Click()
Dim Source As String
Dim Target As String
Dim Sprites As String
Dim Models As String
Dim Sounds As String
Source = dirSource.Path + "\"
Target = dirCS.Path + "\"
Sprites = Target + "sprites\"
Models = Target + "models\"
Sounds = Target + "sound\weapons\"
FileCopy Source & "*.spr", Sprites
FileCopy Source & "*.mdl", Models
FileCopy Source & "*.wav", Sounds
When I try to use this all that happens is that I get an error 52.
I'm not too sure whether I can use wildcards with filecopy, but I don't know any other way of moving files from one place to another.