13
Answers

[SOLVED] CmdLine Process

Jay Webster

Jay Webster

13y
5.4k
1
Hi,

I am trying to run a console app through console when running my winform app.

I want to run the following: abgx360 -ctxa --rgn 00FE0000 -- "F:\game.iso" > "C:\output.txt"

It should run through and produce output to output.txt. If I run it through on the command line directly, it works.

When I run it on my app it runs through but does not output to the file, I think the problem is with the > (Char)62.

Does > on a command line mean the same as (char)62? Should I be using something different?

I have been to the developer of the app and he is stumped, and since it works on the command line, I can only assume that it must be something wrong with my code.

I have the following code:

  private void RunAbgx()
  {
  const string abgxPath = @"C:\Windows\SysWOW64\abgx360";
  var outputPath = @"C:\output.txt";
  var argument = " -ctxa --rgn 00FE0000 -- " + (Char)34 + txtPath.Text + (Char)34 + " " + (Char)62 + " " + (Char)34 + outputPath + (Char)34;
  // argument is:  -ctxa --rgn 00FE0000 -- "F:\game.iso" > "C:\output.txt"
  var pProcess = new Process
  {
  StartInfo =
  {
  FileName = abgxPath,
  UseShellExecute = false,
  Arguments = argument,
  RedirectStandardOutput = false
  }
  };
  pProcess.Start();
  pProcess.WaitForExit();
  }
Answers (13)