Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Folder pop up...

Status
Not open for further replies.

bdfigler

Programmer
Oct 12, 2001
58
0
0
US
Ever install a program and when you're done the folder where everything is installed pops up? How is that done?? Thanks! -Brad
 

Hi,

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]

VCA.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top