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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP needed with a setup program

Status
Not open for further replies.

lixtifur36

Programmer
May 27, 2005
5
US
I am making a setup program in Visual Basic for my Access App. I want the setup program to Opthen the Access program, which works fine. I also want it to display the folder in a window on screen, which I cannot get to work. Can anyone please help. I should have the setup program test if MS Access exists. Is that possible to do in VB?
My code is as follows:

Option Explicit
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



Private Sub Command1_Click()
Dim startUp As Long

startUp = ShellExecute(0, "OPEN", "c:\test.mdb", vbNullString, vbNullString, 3) 'works fine
startUp = ShellExecute(0, "Explore", "c:", vbNullString, vbNullString, 2) 'does not show the window
End ' end the program

Thank you
 
I tested your code and can see the Explore does not open the folder to be visible, but leaves it in a Minimized state. Change the "2" at the end of your parameters to a "3", like you have in your first line of code, and the Windows Explorer window will be visible.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top