CodeItBetter Programming Another VB Programming Blog

How to Launch given folder (not explorer; just open)

Posted on September 16, 2011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'System & API - How to Launch given folder (not explorer; just open)

Option Explicit
 
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _
    ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_SHOWNORMAL = 1
 
Public Sub OpenDirectory(Directory As String)
    ShellExecute 0, "Open", Directory, vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
 
'How can I call this routine:
Private Sub Form_Load()
    Call OpenDirectory("C:\")
End Sub
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.