Simply trying to copy a directory of files. Zhere is the code. It
works for about 7 files and then it hangs... not sure what is going
on. It is not a file issue as copying the directory by hand works just
fine. btw, it seems to hang on the filecopy statement

Dim Myfile As String = "", Mypath As String = "\\Server1\BACKUP",
Myname As String = ""

Dim MyPathTwo As String = "\\Server2\Webtest"
Dim Myfiletwo As String = "", Mytime As Date

Myname = Dir("\\Server1\BACKUP\*.*")
        Do While Myname <> ""
            Myfile = Trim(Mypath) & "\" & Trim(Myname)
            Myfiletwo = Trim(MyPathTwo) & "\" & Trim(Myname)
            If Not System.IO.File.Exists(Myfiletwo) Then
                System.IO.File.Copy(Myfile, Myfiletwo)
            End If
            Myname = Dir()
        Loop

Reply via email to