The following VB.NET code shows how to perform a file search within a specified folder and all of its sub-folders.
Imports System.IO Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Call RecursiveSearch("h:\myfiles") MsgBox(stOut) End Sub Dim stOut As String Sub RecursiveSearch(ByVal stPath As String) Dim stFolders() As String = Directory.GetDirectories(stPath) Dim stFiles() As String = Directory.GetFiles(stPath) For Each stFile As String In stFiles If stFile.Substring(stFile.Length - (stFile.Length - InStrRev(stFile, "\"))) = Me.TextBox1.Text Then stOut = stOut & stFile & vbNewLine End If Next For Each stFolder As String In stFolders Call RecursiveSearch(stFolder) Next End Sub End Class