Sub Copy(ByVal SourcePath As String, ByVal DestinationPath As String)
'拷贝指定目录下所有文件到另一位置
'by VBDN 2005-8-26 http://blog.youkuaiyun.com/vbdn/
'注意:SourcePath,DestinationPath这两个目录一定要存在,否则会出错
'使用举例: Copy "c:/temp", "c:/a" 将会把目录c:/temp下所有文件拷贝到c:/a下
Dim sFile As String
SourcePath = Replace(SourcePath & "/", "//", "/")
DestinationPath = Replace(DestinationPath & "/", "//", "/")
sFile = Dir(SourcePath, vbNormal Or vbHidden Or vbArchive Or vbReadOnly)
Do While Len(sFile) > 0
Debug.Print SourcePath & sFile, DestinationPath & sFile
FileCopy SourcePath & sFile, DestinationPath & sFile
sFile = Dir '下一个文件
Loop
End Sub