-4

I am using the following code:

Process process = new Process();
ProcessStartInfo info = new ProcessStartInfo(@"java -jar path\Ontologizer.jar  -g   path\go.obo  -a   path\gene_association.fb  -m Benjamini-Hochberg -c Parent-Child-Intersection -p   path\back.txt  -s   path\genes.txt  -o path\outfull.txt");

process.StartInfo = info;
process.Start();
process.WaitForExit();
process.Dispose();

I get a Win32 exception:

The system cannot find the file specified

How can I fix this problem?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user2080209
  • 749
  • 3
  • 8
  • 25

1 Answers1

3

First argument of ProcessStartInfo constructor should be file name only. All arguments to application should be putted into second argument of ProcessStartInfo constructor:

new ProcessStartInfo("java", @"-jar path\Ontologizer.jar  -g   path\go.obo  -a   path\gene_association.fb  -m Benjamini-Hochberg -c Parent-Child-Intersection -p   path\back.txt  -s   path\genes.txt  -o path\outfull.txt");
user4003407
  • 21,204
  • 4
  • 50
  • 60