Reputation: 5
I'm trying to start application "GA.exe", but on start it's taking data from file "acc.txt". If I start it normallly (via double click :-)) it works, but if I use code below it say "Can't find acc.txt".
My first idea:
Process.Start(pathToGA.exe);
Second idea:
ProcessStartInfo pinfo = new ProcessStartInfo()
{
Arguments = FolderWithGA.exePath,
FileName = pathToGA.exe,
};
And both don't work.
Upvotes: 0
Views: 455
Reputation: 351456
You should set ProcessStartInfo.WorkingDirectory
to the directory that holds acc.txt
and GA.exe
:
ProcessStartInfo pinfo = new ProcessStartInfo()
{
Arguments = FolderWithGA.exePath,
FileName = pathToGA.exe,
WorkingDirectory = FolderWithGA
};
Upvotes: 3