473,224 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Quastion about Process in C#

i am starting an exe and want to find out in runtime when that exe end!
Is there a way to wait after start process until it end ?
// MY CODE:

string currentPfxPass ="MyPass"
string pfxDir =@"C:\MypfxFile.pfx";

ProcessStartInfo startInfo = new ProcessStartInfo("ImportPFX.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments =" " +pfxDir+ " "+currentPfxPass;
Process.Start(startInfo);

thank you

Saleh Matani
Dec 1 '05 #1
3 1808

"Saleh Matani" <sa***@matani.net> wrote in message
news:eY*************@TK2MSFTNGP12.phx.gbl...
i am starting an exe and want to find out in runtime when that exe end!
Is there a way to wait after start process until it end ?
// MY CODE:

string currentPfxPass ="MyPass"
string pfxDir =@"C:\MypfxFile.pfx";

ProcessStartInfo startInfo = new ProcessStartInfo("ImportPFX.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments =" " +pfxDir+ " "+currentPfxPass;
Process.Start(startInfo);

thank you

Saleh Matani


Take a look at the WaitForExit member of the process class,

Simon
Dec 1 '05 #2
Simon Watson wrote:
"Saleh Matani" <sa***@matani.net> wrote in message
news:eY*************@TK2MSFTNGP12.phx.gbl...
i am starting an exe and want to find out in runtime when that exe end!
Is there a way to wait after start process until it end ?
// MY CODE:

string currentPfxPass ="MyPass"
string pfxDir =@"C:\MypfxFile.pfx";

ProcessStartInfo startInfo = new ProcessStartInfo("ImportPFX.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments =" " +pfxDir+ " "+currentPfxPass;
Process.Start(startInfo);

thank you

Saleh Matani

Take a look at the WaitForExit member of the process class,

Simon

thank you Simon ;)
Dec 1 '05 #3
Hi
You can also get error and state information back from you app.

yourProcess.StartInfo.RedirectStandardOutput = true;
yourProcess.StartInfo.RedirectStandardError = true;

and read it into a stream :- yourProcess.StandardOutput.ReadToEnd()

see:-
http://msdn.microsoft.com/library/de...utputtopic.asp

Hope this helps...

Dec 1 '05 #4

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

Similar topics

1
by: Sean | last post by:
I can connect to a machine remotely with no problems but I'm having trouble trying to create a process remotely. Initially this was a perl and VB script which I'm converting to python. Its entire...
0
by: Justin Johnson | last post by:
Hello, I was wondering if anyone has seen this behavior before for the process.py module available at http://starship.python.net/crew/tmick/. I've been using it quite well on windows 2000...
1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
11
by: Mike M | last post by:
Is it possible? In the parent process, I have a socket that binds, listens and then accepts new connections (which creates new sockets in the process). I want to be able to pass some of these new...
12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
2
by: Saleh Matani | last post by:
Hello , i have an exe programme that i need to call from C# Programm that i wrote but with Arguments. for example compress.exe "MyFolder" "zipPassword" P.s. i know that the...
11
by: Jon Davis | last post by:
Does anyone know why using System.Diagnostics.Process to "wrap" a console application does not always transmit the I/O, depending on what processes you're trying to "consume"? PowerShell, for...
4
by: =?Utf-8?B?U3Jhag==?= | last post by:
There is a process A that launches process B as a COM object. If the User tries to end process A, process B should also end. But vice versa is not true. Process A can run independant of process. It...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.