473,498 Members | 1,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to start a process from c#?

Hi

The application I am working on should start an external exe application and
wait for its result. The external application is most likely not a .net app.
How can I call the exe from c# code and get the result code or when the exe
finished processing?
Thanks
Nov 16 '05 #1
3 10569
Hi,

Take a look at System.Diagnostics.Process

and ExitCode property.

Cheers,i
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"R.A." <te**@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi

The application I am working on should start an external exe application and wait for its result. The external application is most likely not a .net app. How can I call the exe from c# code and get the result code or when the exe finished processing?
Thanks

Nov 16 '05 #2
using System.Diagnostics
....
Process x = Process.Start("XYZ.EXE");
x.WaitForExit();
int exitCode = x.ExitCode;

(Note: I didn't test this code)

Niki

"R.A." <te**@hotmail.com> wrote in
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi

The application I am working on should start an external exe application and wait for its result. The external application is most likely not a .net app. How can I call the exe from c# code and get the result code or when the exe finished processing?
Thanks

Nov 16 '05 #3
R.A. <te**@hotmail.com> wrote:
The application I am working on should start an external exe application and
wait for its result. The external application is most likely not a .net app.
How can I call the exe from c# code and get the result code or when the exe
finished processing?


See http://www.pobox.com/~skeet/csharp/faq/#process.start

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5823
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to...
1
2019
by: Marc | last post by:
I want to write a C#/ASP.NET application where a user can go to a web page, start running a job, close their browser, and then come back later and see the results. The purpose for this application is...
1
2341
by: Sin Jeong-hun | last post by:
Many applications need to lanch a web browser to show its homepage to users. I used System.Diagnosis.Process.Start("http://www.google.com"); Or I launched other application like...
6
6826
by: Dmitri Shvetsov | last post by:
Hi, Can I start an external process from the Web Service? I'm using a code, compiler keeps silence, compiles ok and starts the project. When I trace in Debugger it doesn't start an external...
4
14178
by: Yiu | last post by:
upgent help i want to start IE explorer using C# i try many code such as below: ProcessStartInfo startInfo = new ProcessStartInfo("IEXPLORE.EXE"); Process.Start(startInfo); or Process...
10
15890
by: Tony | last post by:
I am running an application called AcroComm.exe to poll time clocks here at our company. I have written a small C# app that will poll the clocks based on information found in a DB. My problem is...
5
16437
by: Dean Slindee | last post by:
I have looked everywhere I can think of for the .exe name of the Windows Picture and Fax Viewer. Anybody know what it's named? Thanks, Dean Slindee
9
2316
by: richwood | last post by:
Ok....Super newbie here in C#... I am trying to write an application (myapp.exe) that will start an application called abc.exe and if it is terminated, will restart it. (or rerun myapp.exe) I...
0
2224
by: henning.friese | last post by:
Hello NG, I'm need to write some code which creates tiff files from various document types (doc, pdf, xls). I want to do this by ShellExecuting (via System.Diagnostics.Process) the doc-files...
2
3865
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I have an exe application that I want to start remotely.Once I start the application, I want to press ok to that application. To start the application, I did...
0
7004
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7167
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5464
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.