C#-APP: Process.Start() Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SirBe
    New Member
    • Nov 2008
    • 2

    C#-APP: Process.Start() Issue

    I'm making a mod manager for Cortex Command. When I try to start the game using Process.Start() , I get an error in Cortex Command (not my program).



    I'm assuming that Settings.ini is the first file that Cortex Command reads from, so there's obviously some issue with Cortex Command reading from files when executed from the shell.

    I either need a fix for this, or an alternative method for starting applications with C#.

    By the way, here is my code:

    Code:
    Process proc = new System.Diagnostics.Process();
    proc.StartInfo.FileName = CCpath + @"\Cortex Command.exe";
    proc.Start();
    Thank you.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    I think you just need to make sure and supply the startuppath that the .exe wants

    Comment

    • SirBe
      New Member
      • Nov 2008
      • 2

      #3
      Thank you, the issue has been resolved. I changed the proc.StartInfo. WorkingDirector y property to the path it needed.

      My code now looks like this:

      Code:
      Process proc = new Process();
      proc.StartInfo.FileName = CCpath + @"\Cortex Command.exe";
      proc.StartInfo.WorkingDirectory = CCpath;
      proc.Start();

      Comment

      Working...