Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleOpen Windows Explorer to display files in a specific directory in Visual Basic 6
DescriptionThis example shows how to open Windows Explorer to display files in a specific directory in Visual Basic 6.
KeywordsWindows Explorer, shell, open, files, Visual Basic 6
CategoriesFiles 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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated