Function FindAllFiles(ByVal dir As String) Dim dirInfo As New IO.DirectoryInfo(dir) Dim files As New System.Text.StringBuilder Try For Each file In dirInfo.GetFiles() If Not file Is Nothing Then files.AppendLine(file.FullName) End If Next For Each directory In dirInfo.GetDirectories() For Each file In FindAllFiles(directory.FullName) files.AppendLine(file) Next Next Catch files.AppendLine("Error: " & dir) End Try Return files.ToString End Function