[RESOLVED] How To Run An EXE File, From My Project?
I am writing a setup program, and wish to have the project to run another EXE file with it, when you click "Command6". I am thinking that you have the program to execute a Shell command, but I don't know the syntax of it, at all.
Could you please send the right syntax for running a exe file, from within a exe file. Thanks in advance!!
Re: How To Run An EXE File, From My Project?
Use Shell function:
Code:
Shell "c:\anotherexe.exe", vbNormalFocus
Re: [RESOLVED] How To Run An EXE File, From My Project?
Another option is to use the ShellExecute API
Code:
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 Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, vbNullString, "anotherexe.exe", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
Re: [RESOLVED] How To Run An EXE File, From My Project?
I will try that. And thanks for the input!!