I checked in the internet for getting the path of an executable file that is run. I found the answer:
string executingApplicationPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
which returns the path of the C# application I am running. I was unable to find a way of returning the path of an executable file that I am running using the Process Class:
Process.Start("runningExecutableFile.exe", "arguments");
the C# executable file that runs the "runningExecutableFile.exe" is located in the directory of this file. I need exactly this directory. The problem is that this "runningExecutableFile.exe" may be situated in different directories and I just want to copy the .exe file of my C# application to this directory and find programmatically the path in which the file is located.
Please help.