I’ve made an application that uses another company’s exe to generate some output files based upon calculations done on some input files that are passed into the company’s exe… For the exe to work it will look for these input files in the same directory as the location of the exe file.
For the output files, I’ve found out that the folder that these are output to when the exe is run from my program is different to when the exe is ran in a Windows Explorer..
- When the exe is run in windows explorer these are output to the same directory that the exe is located in
- When my program is ran (in debug from visual studio) these are output to the debug folder
Does anyone know how to make my program output these files to the same directory or why this could be happening?
I don’t know anything else about the code within this exe other than its been written in Fortran.
I am running the exe using Process.Start(exeName).WaitForExit()
You’re probabbly searching for Directory.SetCurrentDirectoty function.
Call it before actually executing external exe program. Pass into it a folder complete path where you would like to see the output files, this may resolve your issue.