Starting another App, but in its directory

Denaes

Senior Contributor
Joined
Jun 10, 2003
Messages
956
This line:

Visual Basic:
System.Diagnostics.Process.Start(Path)

is used for vb to start another application.

Apparently, this starts up the application with its' current directory being your applications directory.

ex:

your program is starting in "C:\MyVBNetDirectory\"
Visual Basic:
System.Diagnostics.Process.Start(C:\ApplicationDirectory\Application.exe")

It looks like this will result in the files 'working directory' being "C:\MyVBNetDirectory"

If the application you're running uses absolute paths, then all works pretty well. Also having the dll's registered with the system makes it happy.

Apparently I found a piece of professional (Novell) software which this isn't the case.

I try to run a Novel Backup from another directory and I get an error that it can't find the Dll's, which are located in this applications directory.

It works when I move my VB.Net application over to the Novell Directory, but when its in its own directory, I get the error.

I'd much rather have one directory with ALL of my .net applications in it, rather than having them all spread to the winds in random directories.

Is there another way to start an application or to insure the application starts in its own directory?
 
you will have to do something like this:

Visual Basic:
Dim P as New Process
P.StartInfo.WorkingDirectory = "Novell Dir"
P.StartInfo.FileName = "Novell Exe"
P.Start()



Dan
 
I'm not at work until monday again, but that looks logically sound to me.

Set the WorkingDirectory, exe and start it.

I'll try that, thank you :)
 
Back
Top