I\'m a .NET user, and my goal is as simple as finding the absolute path of the directory of my main executing assembly (the EXE file).
I have several candidates:
Use System.Linq
string MainExecutablePath= (System.Diagnostics.Process.GetProcesses().First(P =>P.MainWindowTitle == "MainExecutable'sWindowName")).MainModule.FileName.ToString();