I have a source folder containing hundreds of gif's
I have a destination folder containing a few gif's (which I don't want to overwrite)
I'm using the File System Object to copy the gif's to the destination using this code
sub copyImages
on error resume next
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Check if destination images folder exists. If it doesn't then create it.
If objfso.FolderExists(pathDest) = False Then
objFso.CreateFolder (pathDest)
End if
objFSO.CopyFile "c:\wwwroot\articles\*.gif", pathDest, false 'don't overwrite
set objFso=nothing
on error goto 0
end sub
The code above fails if there is a gif with the same name in both source and destination folders.
If the first gif to be copied raised the error, no gifs would be copied.
I know that I need to create a collection of files (gif's) and iterate through them copying one at a time but I cannot find any code examples anywhere.
Thanx in advance.