After execution

  • Thread starter Thread starter Dakkar
  • Start date Start date
D

Dakkar

I wrote a line like this for executing the program that i want

System.Diagnostics.Process.Start(uopath +
@"\client.exe");

and i want to call a function after this program succesfully executed
so i write the line like this

[code:1:71767090a2]
System.Diagnostics.Process.Start(uopath +
@"\client.exe");
uocfgafter();
[/code:1:71767090a2]

but its calling the function right after try to start executing
client.exe
are there anyway to call the function after client.exe succesfully
executed?
Thanks
*---------------------------------*
Posted at: http://www.GroupSrv.com
*---------------------------------*
 
To block until process terminates -
System.Diagnostics.Process.Start(uopath +
@"\client.exe").WaitForExit();

To check if the process was successful
Process clientProc = System.Diagnostics.Process.Start(uopath +
@"\client.exe");

clientProc.WaitForExit();

if (clientProc.ExitCode != 0) {
// some problem
}
 
Back
Top