|
|
Title | Open Windows Explorer to display files in a specific directory in Visual Basic 6 |
Description | This example shows how to open Windows Explorer to display files in a specific directory in Visual Basic 6. |
Keywords | Windows Explorer, shell, open, files, Visual Basic 6 |
Categories | Files and Directories |
|
|
When you click the program's button, it builds a string of the form:
explorer.exe /e, C:\somedir\subdir
and executes this command with Shell.
|
|
Private Sub btnOpenWindowsExplorer_Click()
Const QUOTE As String = """"
Dim path As String
path = Replace(txtPath.Text, QUOTE, QUOTE & QUOTE)
Shell "explorer.exe /e, " & path, vbNormalFocus
End Sub
|
|
|
|
|
|