I have two exe files in the same folder, I can run exe2 from a button in exe1. Today I was observing a customer over a remote (terminal services) session and exe2 failed to
You should use AppDomain.CurrentDomain.BaseDirectory.
For example in a windows services application:
System.Environment.CurrentDirectory will return C:\Windows\system32
While
AppDomain.CurrentDomain.BaseDirectory will return [Application.exe location]
Another important factor to note is that AppDomain.CurrentDomain.BaseDirectory is a readonly property while the Environment.CurrentDirectory can be something else if necessary:
// Change the directory to AppDomain.CurrentDomain.BaseDirectory
Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;