Where to insert "application.startuppath" code?

K

kimiraikkonen

Hello experts,
I want my external application run from the root folder where my
project (.exe) resides. For example, my main project (.exe) should be
in the same directory with my external file works with parameter "-b".
But i couldn't know where to insert application.startuppath. That code
block works OK but "doit.exe" only runs from "c:\". I want it to run
in any directory as enough to be in the same directory with my
compiled exe project. Here is my code:

Dim psInfo As New System.Diagnostics.ProcessStartInfo("c:\doit.exe", "-
b")
psInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Normal
Dim myProcess As Process =
System.Diagnostics.Process.Start(psInfo)
myProcess.WaitForExit()
MsgBox("Completed", MsgBoxStyle.Information, "Completed")


How can i configure or put application.startup line?

Thank you.
 
K

kimiraikkonen

Hi again :)

Ok i've fixed by typing:

psinfo.workingdirectory = application.startuppath before
process start line.

Now it's OK. Very thanks.
 

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