Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exit code and waitforexit()

Status
Not open for further replies.

angela4eva

Programmer
Apr 29, 2005
46
US
I am using the below code for waiting for the process to finish before i get to next process

Dim myProcess As Process = System.Diagnostics.Process.Start("main.exe")
myProcess.WaitForExit()
myProcess.Close()

Dim myProcess1 As Process = System.Diagnostics.Process.Start("seco.exe")
myProcess1.WaitForExit()
myProcess1.Close()
I want to make sure that the main.exe finished properly...otherwise want to give an error message
If i take the exit code(myprocess.exitcode) and if it is equal to 0 then is it safe to assume that the .exe executed successfully?what is the best way to handle this
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top