If your application is a Windows Forms application, you can use a static application class, as others have noted. For other uses, use reflection:
Dim a = System.Reflection.Assembly.GetEntryAssembly()
Dim location = a.Location
I had to do it the other day, it works fine.
source
share