You can use the shell command to launch explorer with a given path. First you need to figure out where explorer is located. One way is to assume that is is in the sytem directory (I don't know if this is true on all windows systems) and then use the filesystemobject:
---------------------------------------------------------
Set fso = CreateObject("Scripting.FileSystemObject"
syspath = fso.getspecialfolder(0) ' get WinSysPath
Shell syspath & "\explorer.exe d:\tmp", vbNormalFocus
---------------------------------------------------------
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
One might also use the venerable ShellExecute....[tt]
Private 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
Const SW_SHOWNORMAL = 1
[/tt]
This will open the c:\windows\temp folder in a new window...
[tt]
Private Sub Command1_Click()
ShellExecute Me.hwnd, _
vbNullString, _
"c:\windows\temp", _
vbNullString, _
"C:\", _
SW_SHOWNORMAL
End Sub
[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.