I have a UI application that is running in AppStream 2.0. I have a command button, that when pressed, makes an external call to a command line EXE.
I am using the ProcessStartInfo object to pass in the arguments.
var startInfo = new ProcessStartInfo
{
FileName = @"My.exe",
Arguments = '"' + jobNameToExecute + '"',
WindowStyle = ProcessWindowStyle.Normal
};
I then instantiate a Process, providing the ProcessStartInfo created above.
var ExternalProcess = new Process {StartInfo = startInfo};
ExternalProcess.Start();
ExternalProcess.WaitForExit();
The process is erroring out with:
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at
I can only assume that it isn't able to find the command line EXE. Do I need to provide a path for the EXE I'm calling? Can I use the path of the currently executing UI EXE?
Any insight would be appreciated.