• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Make a GUI to launch a few programs

Net

Golden Member
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
 
MessageBox.Show(Application.StartupPath)

MessageBox.Show(System.Reflection.Assembly.GetExecutingAssembly().Location)

Should both work (one is the path the other is the exe) however I'm wondering if it'd because it's being run off CD as that looks like a temporary extraction path of some sorts....
 
Back
Top