I have three programs that I put on a CD.
I want to make a GUI with three buttons, when you click on one of the buttons it will launch one of the programs.
I tried visual basic .net 2008
Shell("myprogram.exe -applaunch", vbNormalFocus)
that works fine when you run the debugger. However it does not work after the program has been published (build as an executable). This is because its not running from the same directory as where those 3 programs are.
So I tried this:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
path = My.Application.Info.DirectoryPath
End Sub
Then in the Button function:
Dim execute As String
execute = path + "\myprogram.exe -applaunch"
Shell(execute, vbNormalFocus)
same story.
Then I ran
MsgBox(path)
so I could see where this was launching from. The result was C: \Documents and Settings\ ... \ VQXASDKF242MASNS.RV1\dna.tion_cd08f4224lkjhwh2h3_3428298s8a98as9
hrm...
Help
I want to make a GUI with three buttons, when you click on one of the buttons it will launch one of the programs.
I tried visual basic .net 2008
Shell("myprogram.exe -applaunch", vbNormalFocus)
that works fine when you run the debugger. However it does not work after the program has been published (build as an executable). This is because its not running from the same directory as where those 3 programs are.
So I tried this:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
path = My.Application.Info.DirectoryPath
End Sub
Then in the Button function:
Dim execute As String
execute = path + "\myprogram.exe -applaunch"
Shell(execute, vbNormalFocus)
same story.
Then I ran
MsgBox(path)
so I could see where this was launching from. The result was C: \Documents and Settings\ ... \ VQXASDKF242MASNS.RV1\dna.tion_cd08f4224lkjhwh2h3_3428298s8a98as9
hrm...
Help