This is a working Console app:
vb.net Code:
Module Module1
Sub Main()
Dim allPaths = New List(Of String) From {"\Root\Folder1",
"\Root\Folder1\Folder1a",
"\Root\Folder1\Folder1a\Folder1aa",
"\Root\Folder2"}
Console.Write("Please enter a root path: ")
Dim rootPath = Console.ReadLine()
Do Until String.IsNullOrWhiteSpace(rootPath)
Dim rootPathLength = rootPath.Split(New Char() {"\"c}, StringSplitOptions.RemoveEmptyEntries).Length
Dim matchingPaths = allPaths.Where(Function(s) s.StartsWith(rootPath, StringComparison.CurrentCultureIgnoreCase) AndAlso
s.Split(New Char() {"\"c}, StringSplitOptions.RemoveEmptyEntries).Length = rootPathLength + 1)
Console.WriteLine("Matching paths:")
For Each path In matchingPaths
Console.WriteLine(path)
Next
Console.Write("Please enter a root path: ")
rootPath = Console.ReadLine()
Loop
End Sub
End Module