0

Can anyone help me regarding this issue.

          string strEnvironmentalPath = Environment.GetEnvironmentVariable("PATH");
        startInfo = new ProcessStartInfo(@strEnvironmentalPath);           
        startInfo.UseShellExecute = false;
        startInfo.FileName = "Knime.exe";
        startInfo.Arguments = strParameters;
        startInfo.CreateNoWindow = true;           
        Process = Process.Start(@startInfo);          
        Process.CloseMainWindow();
        startInfo.WindowStyle = ProcessWindowStyle.Hidden;
        Process.WaitForExit();

I get this error: System cannot find the file specified.

codelab
  • 406
  • 3
  • 14
  • It seems that the file **Knime.exe** is not in your PATH. Please check this. – codelab Oct 07 '16 at 08:49
  • What is the use of creating a new `ProcessStartInfo` with the file name and then resetting the file name? – Patrick Hofman Oct 07 '16 at 08:49
  • Obvious question really but ..... is Knime.exe in the current folder or in any of the folders listed in PATH. – PaulF Oct 07 '16 at 08:50
  • `Environment.GetEnvironmentVariable("PATH");`returns all the paths in the PATH variable...what's the point of passing that to the new ProcessStartInfo? – Pikoh Oct 07 '16 at 08:51
  • Try giving the absolute path for the "Knime.exe" , only reason for this error might be its not able to find the "Knime.exe" in your "PATH" – SoftwareNerd Oct 07 '16 at 08:52
  • 1
    Take a look at the accepted answer to this: http://stackoverflow.com/questions/12392913/process-start-and-path-environment-variable – tolanj Oct 07 '16 at 08:53

0 Answers0