I need to copy and overwrite a number of files programmatically and I'd like
to know how to modify the following code from technet to use an array of
"copy from" names.
'starting point
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\FSO\ScriptLog.txt" , "D:\Archive\", OverwriteExisting
'end starting point
'start pseudo code
dim ary(3)
ary(1) = "C:\FSO\ScriptLog1.txt"
ary(2) = "C:\FSO\ScriptLog2.txt"
ary(3) = "C:\FSO\ScriptLog3.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
For i = 1 to 3
' something on the lines of:
objFSO.CopyFile "" & ary(3) &"" , "D:\Archive\", OverwriteExisting
Next
'end pseudo code
Any help will be greatly appreciated.
Thanks,
Raul