By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,423 Members | 1,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,423 IT Pros & Developers. It's quick & easy.

Process invoking an executable

P: n/a
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.

Aug 6 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
orsula <or******@gmail.comwrote:
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.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Aug 6 '08 #2

P: n/a
On Aug 7, 12:27*am, Jon Skeet [C# MVP] <sk...@pobox.comwrote:
orsula <orsul...@gmail.comwrote:
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.

--
Jon Skeet - <sk...@pobox.com>
Web site:http://www.pobox.com/~skeet*
Blog:http://www.msmvps.com/jon.skeet
C# in Depth:http://csharpindepth.com


Thanks a lot for your help Jon :)
Aug 7 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.