471,354 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

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.exe" from within C#. I have tested my code with "Notepad.exe" 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\coreftp.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.WorkingDirectory = @"C:\Program Files\CoreFTP";
proc.StartInfo.FileName = "coreftp.exe";
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.
Jun 28 '07 #1
2 2903
TRScheel
638 Expert 512MB
Hi All-

I was wondering if anyone could help me with this issue. I am trying to run this 3rd party application called "CoreFTP.exe" from within C#. I have tested my code with "Notepad.exe" 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\coreftp.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.WorkingDirectory = @"C:\Program Files\CoreFTP";
proc.StartInfo.FileName = "coreftp.exe";
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.
Jun 28 '07 #2
I tried that right now and no luck. Same error.
Jun 28 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by leroybt.rm | last post: by
7 posts views Thread by erniedude | last post: by
21 posts views Thread by sachin dooble | last post: by
4 posts views Thread by Wasi Rehman | last post: by
1 post views Thread by GaryDean | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.