VB.NET:
Dim f() As String = Directory.GetFiles(fromDir)
For i As Integer = 0 To UBound(f)
File.copy(f(i), toDir & "\" & fileNameWithoutThePath(f(i)))
Next
'********************
Public Function fileNameWithoutThePath(ByVal b As String) As String
Dim j As Int16
j = Convert.ToInt16(b.LastIndexOf("\"))
Return b.Substring(j + 1)
End Function
Last edited by a moderator: