stringArrayOfMatches = Directory.GetFiles("C:\", "*BC-230902-1*", SearchOption.AllDirectories)
Characters other than the wildcard are literal characters. For example, the searchPattern string "*t" searches for all names in path ending with the letter "t". The searchPattern string "s*" searches for all names in path beginning with the letter "s".Source
Imports System.IO
Module Module1
Sub Main()
Dim path = "C:\!quick"
Dim filter = "*DevComponents*"
Dim options = SearchOption.AllDirectories
Dim results = Directory.GetFiles(path, filter, options)
For Each item In results
Console.WriteLine(item)
Next
Console.ReadLine()
End Sub
End Module
On my system produces the following output -Imports System.IO
Module Module1
Sub Main()
Dim paths As New List(Of String) From {"C:\!quick", "C:\inetpub", "C:\_admin"}
Dim filter = "*DevComponents*"
Dim options = SearchOption.AllDirectories
Dim results As New List(Of String)
For Each path As String In paths
results.AddRange(Directory.GetFiles(path, filter, options).AsEnumerable())
Next
For Each item In results
Console.WriteLine(item)
Next
Console.ReadLine()
End Sub
End Module
Produces the following output on my system -
Something like (look at the link for more details)
stringArrayOfMatches = Directory.GetFiles("C:\", "BC-230902-1", SearchOption.AllDirectorie
seems to be pretty much what you want. That should return all matches as an array of file name AND folder path