Possible Duplicate:
How do I get the application exit code from a Windows command line?
I have a console application. It will be executed from command prompt. It will return either 0 or 1 from main method. How can I know that what value is returned by the application?
To check the exit code we can simply print the $? special variable in bash. This variable will print the exit code of the last run command. $ echo $?
To display the exit code for the last command you ran on the command line, use the following command: $ echo $?
Environment.Exit(exitCode); Use exitCode as 0 (zero) to show that the process completed successfully. Environment.
To close an interactive command prompt, the keyboard shortcut ALT + F4 is an alternative to typing EXIT.
Assuming you're on Windows (C# tag)
echo %errorlevel%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With