Imports System.IO
Public Class Form1
Private dir As New IO.DirectoryInfo("C:\Test Folder") 'Change the folder path as needed
Private fileArray As IO.FileInfo() = dir.GetFiles("*.*") 'Change *.* to filter file extensions/names, ex. *.txt, *.bmp or asdf.*
Private file As IO.FileInfo
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each Me.file In Me.fileArray
lbxFiles.Items.Add(Me.file.FullName)
Next
End Sub
Private Sub lbxFiles_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbxFiles.DoubleClick
If (lbxFiles.SelectedIndex >= 0) Then
Dim proc As New Process
Dim procInfo As New ProcessStartInfo
procInfo.FileName = lbxFiles.SelectedItem.ToString
procInfo.UseShellExecute = True
proc.StartInfo = procInfo
proc.Start()
End If
End Sub
End Class