Private Sub Command1_Click()
Dim fso As Object
Dim SourcePath, TargetPath As String
SourcePath = "C:\Test\"
TargetPath = "D:\Test\"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(TargetPath) Then
fso.CopyFolder SourcePath & "*.*", TargetPath
fso.CopyFile SourcePath & "*.*", TargetPath
Else
fso.CreateFolder (TargetPath)
fso.CopyFolder SourcePath & "*.*", TargetPath
fso.CopyFile SourcePath & "*.*", TargetPath
End If
Set fso = Nothing
MsgBox "完成"
End Sub