Problem running exe in VB.NET

D

Dave Harris

I am rather new to VB.NET so please excuse my ignorance. I am trying to
run a program created with QuickBasic but compiled as a standalone program
using a VB.NET frontend. There is a listbox on the main form which has a
list of numbers. The user selects one of those number then clicks a button
to launch the exe. I am using Windows XP Pro. Here is the code that runs
when the button is clicked....

Dim strFlight As String

Dim strArgu As String

strFlight = LTrim(CType(lstFlights.SelectedItem, String))

Dim oProc As New Process

strArgu = "ah64a1\" & strFlight & "\"

oProc.Start("f:\testing\llroutec.exe", strArgu)

'oProc.StartInfo.FileName = "f:\testing\llroutec.exe"





When the button is clicked, you see a command window open then immediately
shut down. The exe runs fine when started in a cmd.exe window using the
following command, "llroutec.exe ah64a1\1015\". Is my code wrong or do you
think the problem may be with Windows? Any help will really be appreciated.
Thanks in advance!!



Dave
 
M

Mitchell Vincent

Dave said:
When the button is clicked, you see a command window open then immediately
shut down. The exe runs fine when started in a cmd.exe window using the
following command, "llroutec.exe ah64a1\1015\". Is my code wrong or do you
think the problem may be with Windows? Any help will really be appreciated.
Thanks in advance!!

Try running something like Notepad.exe to see if it is getting executed
properly.
 
C

Chris Dunaway

When you run the app from the cmd line, what do you normally see? Does
it do some processing and then exit? Does it remain on the screen with
menus, etc awaiting further input?

What would you normally expect to see?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top