Question Starting exe from listbox from a specific location

Scott

New member
Joined
Jun 28, 2012
Messages
1
Programming Experience
Beginner
Hello all,

I am really new at this, but so far I have managed editting some excisting code and I am trying to build my own little nifty program now in VB 2008 Express.

The goal of the program is to get it to look in different network locations and from a listbox be able to start a program from that network location via a double click in the listbox.

So to make it short:

- I read networkpaths from a txt file (\\a\directory, \\b\directory) and those locations are presented in the listbox
- These network locations all contain an executable but they have the same name (\\a\directory\program.exe, \\b\directory\program.exe, etc)

So far I have come up with " System.Diagnostics.Process.Start("programname")" which starts a program, but my goal is (after a double click on an entry) to get the application to look at the entry in the listbox itself, see which network location it refers to and then start the executable in that location.

Can anyone give me a kick in the right direction? I am still very new at this, but I do believe I pick up quickly...

Thanks in advance!!!

Scott
 
Hello,

If you use a ListView as oppose to a ListBox I think what you are trying to do is this:

Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
Process.Start(Me.ListView1.SelectedItems(0).Text)
End Sub

This is assuming that the full file path and name are stored in your ListView.

Hope that helps
 
Back
Top