Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2007

Tip: Looking for answers? Try searching our database.

Where to insert "application.startuppath" code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kimiraikkonen - 06 Oct 2007 22:03 GMT
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.
Cor Ligthert[MVP] - 07 Oct 2007 16:10 GMT
Kimi,

I assume you mean this one?

http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.startu
ppath.aspx


Cor
kimiraikkonen - 07 Oct 2007 20:19 GMT
On Oct 7, 6:10 pm, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
> Kimi,
>
[quoted text clipped - 3 lines]
>
> Cor

Hello Cor,
Thanks for your response. Good article but i couldn't know where to
put, i get some errors when debugging about "overload failed because
no acceptable "new"...bla bla".

How can i re-organize my code and make my external process run from
root folder where my main project resides?

Thanks.
kimiraikkonen - 07 Oct 2007 20:35 GMT
Hi again :)

Ok i've fixed by typing:

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

Now it's OK. Very thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.