locked
System.Diagnostics.Process.Start problem RRS feed

  • Question

  • System.Diagnostics.

    Process.Start("C:\\ReportForOwner\\reportforowner.EXE\\");

    I'm trying to run upper exe file from my program, but I get error. If I run reportforowner.EXE,

    directly from folder everything is OK. Any ideas why?

    Description:

    Stopped working

    Problem signature:

    Problem Event Name: CLR20r3

    Problem Signature 01: reportforowner.exe

    Problem Signature 02: 1.0.0.0

    Problem Signature 03: 4bd81b3a

    Problem Signature 04: mscorlib

    Problem Signature 05: 2.0.0.0

    Problem Signature 06: 4a27471d

    Problem Signature 07: 349e

    Problem Signature 08: e1

    Problem Signature 09: System.IO.FileNotFoundException

    OS Version: 6.1.7600.2.0.0.256.1

    Locale ID: 1060

    Wednesday, April 28, 2010 2:05 PM

Answers

  • The problem is you haven't set the working directory.

    ProcessStartInfo StartInfo = new ProcessStartInfo("reportforowner.exe");
    StartInfo.WorkingDirectory = @"c:\ReportForOwner";
    Process.Start(StartInfo);
    • Marked as answer by wartmignef Wednesday, April 28, 2010 4:12 PM
    Wednesday, April 28, 2010 4:09 PM

All replies

  • remove the slash after the filename:

    Process.Start("C:\\ReportForOwner\\reportforowner.EXE\\");

    should be

    Process.Start("C:\\ReportForOwner\\reportforowner.EXE");
    • Proposed as answer by xneokr Wednesday, April 28, 2010 2:09 PM
    Wednesday, April 28, 2010 2:08 PM
  • Didn't help...

    Wednesday, April 28, 2010 3:30 PM
  • The problem is you haven't set the working directory.

    ProcessStartInfo StartInfo = new ProcessStartInfo("reportforowner.exe");
    StartInfo.WorkingDirectory = @"c:\ReportForOwner";
    Process.Start(StartInfo);
    • Marked as answer by wartmignef Wednesday, April 28, 2010 4:12 PM
    Wednesday, April 28, 2010 4:09 PM