Run-time error when trying to execute .exe using Process.Start c# .NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • techgirl
    New Member
    • Jun 2007
    • 4

    Run-time error when trying to execute .exe using Process.Start c# .NET

    Hi All-

    I was wondering if anyone could help me with this issue. I am trying to run this 3rd party application called "CoreFTP.ex e" from within C#. I have tested my code with "Notepad.ex e" and that opens up fine. I've tried it with another program executable and it works as well. When I go to run coreftp.exe, it will not work. I have even tried putting code into a .bat file and trying to execute that and it executes, but I get the same runtime error I have detailed below (both when running the .bat file and when running the below code):

    Run-time Error!

    C:\Program Files\CoreFTP\c oreftp.exe

    This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

    This is the code I'm using from within .NET:

    proc.StartInfo. UseShellExecute = true;
    proc.StartInfo. WorkingDirector y = @"C:\Program Files\CoreFTP";
    proc.StartInfo. FileName = "coreftp.ex e";
    proc.Start();

    When I double-click on the program directly, it comes up no problem. Also, when I double-click on the .bat file it works no problem as well. What is the difference between running it in .NET and running it manually? I cannot figure this one out. Any help on this would be AWESOME!

    Thank you.
  • TRScheel
    Recognized Expert Contributor
    • Apr 2007
    • 638

    #2
    Originally posted by techgirl
    Hi All-

    I was wondering if anyone could help me with this issue. I am trying to run this 3rd party application called "CoreFTP.ex e" from within C#. I have tested my code with "Notepad.ex e" and that opens up fine. I've tried it with another program executable and it works as well. When I go to run coreftp.exe, it will not work. I have even tried putting code into a .bat file and trying to execute that and it executes, but I get the same runtime error I have detailed below (both when running the .bat file and when running the below code):

    Run-time Error!

    C:\Program Files\CoreFTP\c oreftp.exe

    This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

    This is the code I'm using from within .NET:

    proc.StartInfo. UseShellExecute = true;
    proc.StartInfo. WorkingDirector y = @"C:\Program Files\CoreFTP";
    proc.StartInfo. FileName = "coreftp.ex e";
    proc.Start();

    When I double-click on the program directly, it comes up no problem. Also, when I double-click on the .bat file it works no problem as well. What is the difference between running it in .NET and running it manually? I cannot figure this one out. Any help on this would be AWESOME!

    Thank you.
    Take off the useshellexecute line and see if that fixes it.

    Comment

    • techgirl
      New Member
      • Jun 2007
      • 4

      #3
      I tried that right now and no luck. Same error.

      Comment

      Working...