Process invoking an executable

O

orsula

Hi all,

First I would like to say that I'm thrilled to be a part of this great
news group!

I'm kinda new to c#, yet I have a tight schedule to deliver my project
(ain't it always like that :) and I have a question regarding a
process invoking another executable.

If you could just point out some keywords which I can google up it can
be really great.
I was given an executable file a.exe which I need to invoke using my
console application.
I googled up and found System.Diagnostics.Process.Start().
How can I get the exit code of a.exe?
Is there a better way than System.Diagnostics.Process.Start?
Is there a way to run a.exe in-process (currently my process ends
while a.exe still goes on)?
What is the best way to do so if my process and a.exe are not on the
same machine?
If I could re-write a.exe and implement object model in it (in c++ I
would use COM) what should I use in c#?

Thank you very much for your help!
Orsula.
 
J

Jon Skeet [C# MVP]

orsula said:
If you could just point out some keywords which I can google up it can
be really great.
I was given an executable file a.exe which I need to invoke using my
console application.
I googled up and found System.Diagnostics.Process.Start().
How can I get the exit code of a.exe?
Process.ExitCode.

Is there a better way than System.Diagnostics.Process.Start?

Not really.
Is there a way to run a.exe in-process (currently my process ends
while a.exe still goes on)?

You can call Process.WaitForExit. You can't run one process inside
another though.
What is the best way to do so if my process and a.exe are not on the
same machine?

Well, you could *try* just running it, but I'm not sure I'd expect it
to work.
If I could re-write a.exe and implement object model in it (in c++ I
would use COM) what should I use in c#?

I'm not entirely sure what you're getting at here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top