JPJedi JPJedi - 10 months ago 47 Question

Executable directory where application is running from?

I need to get the path (not the executable) where my application is running from:


When I run the above statement with & "/images/image.jpg" on my local machine it works fine but when I install the application on another machine it says it cannot find the file and there is a lot of extra path information some.

I just need the directory of where the app is running. I am coding in VB.NET with Visual Studio 2008.


Answer Source
Dim strPath As String = System.IO.Path.GetDirectoryName( _

Taken from HOW TO: Determine the Executing Application's Path (MSDN)