473,624 Members | 2,253 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 10574
Hi,

Take a look at System.Diagnost ics.Process

and ExitCode property.

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

"R.A." <te**@hotmail.c om> wrote in message
news:%2******** *******@TK2MSFT NGP10.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.Diagnost ics
....
Process x = Process.Start(" XYZ.EXE");
x.WaitForExit() ;
int exitCode = x.ExitCode;

(Note: I didn't test this code)

Niki

"R.A." <te**@hotmail.c om> wrote in
news:%2******** *******@TK2MSFT NGP10.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.c om> 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.co m>
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
5835
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 Mandrake 9.2 and am reinstalling everything. This thing is kicking my ass and I can't seem to get past it. I could really use some help if anybody has any. Just for reference, this was my primary source for information on installation and...
1
2037
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 for a user to be able to use a page on our intranet to start running a time-consuming reporting and analysis job. I'm not sure how to start a process in ASP.NET and then "detach" it, or how to check that it's still running later. I think that maybe...
1
2369
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 System.Diagnosis.Process.Start("notepad.exe"); But the problems is the application freezes for a couple of seconds till the application starts. Is there any way to start a process asynchronously, so that my application wouldn't freeze? Should I create a new...
6
6840
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 process. That's strange for me. I understand that it should be a new shell, but why I can't start it? Is it need to have a Windows application to start an external process? I created a very long batch files and a complicated script to work with...
4
14196
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 process = new Process(); process.StartInfo.FileName = "C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE";
10
15906
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 that AcroComm will sometimes stop polling in the middle of the process and terminate. The programing manual for the app says that it sends a code to the operating system when it is done that tells what has happend like the following: 0 ...
5
16449
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
2329
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 have tried it in several scripting languages, but they tend to use ntvdm.exe and peg the processor. Sounds easy, I know...but I am not real "sharp" at this. (horrible pun fully intended)
0
2246
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 with the "print"-verb. This works for me. However, I need to handle the case when a printing application doesnt't quit in a given timespan (for example a password-protected word-document). So I've tried the following:
2
3877
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 Process.start("C://test/app.exe"). I am writing this code in a C# web application, famework 1.1 How can I press ok to that started application. Any help will be apprecaited
0
8238
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8174
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8624
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7164
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2607
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 we have to send another system
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1485
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.