Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

return code of console application [duplicate]

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?

like image 691
Maanu Avatar asked May 17 '11 11:05

Maanu


People also ask

How do I find the exit code for an 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 $?

How do I find my return code using CMD?

To display the exit code for the last command you ran on the command line, use the following command: $ echo $?

How do you exit a code in C#?

Environment.Exit(exitCode); Use exitCode as 0 (zero) to show that the process completed successfully. Environment.

How do you exit a command prompt?

To close an interactive command prompt, the keyboard shortcut ALT + F4 is an alternative to typing EXIT.


1 Answers

Assuming you're on Windows (C# tag)

echo %errorlevel%
like image 59
Brian Rasmussen Avatar answered Oct 29 '22 12:10

Brian Rasmussen