I am having trouble getting the path of my application's executable file at runtime. This application is being started by another executable and whenever I try to use Application.ExecutablePath I get the path to that application instead of mine.
Dim aPath1 As String = Application.ExecutablePath()
Dim aPath2 As String = Application.StartupPath()
in C# it would be
string aPath1 = Application.ExecutablePath;
string aPath2 = Application.StartupPath;
Neither of these give me the path of the program in which those two lines are exectured, they only tell what program started this program.
Any help would be greatly appreciated, Thank you in advance.
try
Assembly.GetExecutingAssembly().Location
see http://msdn.microsoft.com/en-us/library/system.reflection.assembly.location.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With