How to get an exit code from an application. Example: I call: System.Diagnostic.Start(“regsvr32”, “mydll.dll”); How to get an exit code from regsvr32?
And how to write an application which returns an exit code (like regsvr32). Thanks.
I’am using .NET 4.0 & C#.
This is actually two separate questions, but… The exit code is the value returned from the program’s Main function. So:
Will return an exit code of 0. Unless the preceding
// codedoes something different.Use the Process’ ExitCode property to get this value from the application to execute.
0 is typically returned when the program succeeds. Anything else is a failure but this is a matter of interpretation.