Private Sub CopyAllFiles(PathToFiles As String, Destination As String)
Dim FileName As String
Dim CheckForDir, CheckForDestDir As String
If Not Mid(PathToFiles, Len(PathToFiles), 1) = "\" Then PathToFiles = PathToFiles & "\"
If Not Mid(Destination, Len(Destination), 1) = "\" Then Destination = Destination & "\"
'Lets check to see if directory exsits
CheckForDir = Dir(PathToFiles, vbDirectory)
CheckForDestDir = Dir(Destination, vbDirectory)
If CheckForDir = "" Then MsgBox "That directory doesn't exsit!": Exit Sub
If CheckForDestDir = "" Then MsgBox "That directory doesn't exsit!": Exit Sub
FileName = Dir(PathToFiles & "*.*")
Do While Not FileName = ""
FileCopy PathToFiles & FileName, Destination & FileName
FileName = Dir
Loop
MsgBox "files have been copied!"
End Sub
Private Sub Command1_Click()
If Text1 = "" Then Exit Sub
If Text2 = "" Then Exit Sub
CopyAllFiles Text1, Text2
End Sub