XCopyNoFSO




Public Sub subXCopy(strSource As String, strDestination As String)
Dim MyName As String
MyName = Dir(strSource & "\*.*", vbDirectory) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.

If MyName <> "." And MyName <> ".." Then
' Use bitwise comparison to make sure MyName is a directory.

If (GetAttr(strSource & "\" & MyName) And vbDirectory) <> vbDirectory Then
'Copy the file

FileCopy strSource & "\" & MyName, strDestination & "\" & MyName
End If ' it represents a directory.
End If
MyName = Dir ' Get Next entry.
Loop
End Sub

strSource and strDestination represent directory names
without the ending '\'











( xcopynofso.html )- by Paolo Puglisi - Modifica del 17/12/2023