Launch an app from inside a vb program

J

Jm

Hi all

Im using System.Diagnostics.Process.Start to launch external apps from my
app but the working directory seems to point to where my app is located. How
can i get around this and basically say the working directory is the path of
the app that im launching ? I used shellexec api under vb6 is there an
equivalent built into .net ? Any help is greatly apprecuated

Thanks
 
H

Herfried K. Wagner [MVP]

Jm said:
Im using System.Diagnostics.Process.Start to launch external apps from my
app but the working directory seems to point to where my app is located.
How
can i get around this and basically say the working directory is the path
of
the app that im launching ?

\\\
Dim psi As New ProcessStartInfo()
psi.FileName = "C:\foo.exe"
psi.WorkingDirectory = Path.GetDirectoryName(psi.FileName)
Process.Start(psi)
///
 
J

Jm

Hi Herfried

Just what i needed

Thanks

Herfried K. Wagner said:
\\\
Dim psi As New ProcessStartInfo()
psi.FileName = "C:\foo.exe"
psi.WorkingDirectory = Path.GetDirectoryName(psi.FileName)
Process.Start(psi)
///
 

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