Option Explicit
Private Declare Function CopyFile Lib "kernel32" _
Alias "CopyFileA" (ByVal lpExistingFileName As String, _
ByVal lpNewFileName As String, ByVal bFailIfExists As Long) _
As Long
Public Function APIFileCopy(src As String, dest As String, _
Optional FailIfDestExists As Boolean) As Boolean
Dim lRet As Long
lRet = CopyFile(src, dest, FailIfDestExists)
APIFileCopy = (lRet > 0)
End Function
Private Sub Command1_Click()
Dim origen As String
Dim destino As String
origen = Dir1.Path & "\" & File1.FileName
destino = Dir2.Path & "\" & File1.FileName
APIFileCopy origen, destino
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1
End Sub
Private Sub Drive2_Change()
Dir2.Path = Drive2
End Sub