Annoyances.org
Home » Windows Server 2003 Discussion Forum » Message 1227500164 » Entire Thread Search | Help | Home
  
exit command status
Showing all messages in thread #1227500164
Windows Server 2003 Annoyances Discussion Forum


The following are all of the messages in this thread (4 in all), shown in chronological order. Click any message subject to view that message by itself or to view the thread hierarchy.
exit command status
Sunday, November 23, 2008 at 8:16 pm
Posted by jigneshjsoni (41 messages posted)

Exit command status returns 0, if command is successful and non-zero if command is not running successfully. If a command is run on cmd prompt and if that command is running successfully, I will get the output. So when do I get 0 instead of output on success ? If command does noy run successfully, I get error message. When do I get non-zero value instead of error message ?

[Reply or follow-up to this message]

Tip: Run a free scan for common Windows errors ad

re: exit command status
Friday, December 5, 2008 at 8:27 am
Posted by appleoddity (2369 messages posted)

Its two different things. You're asking about a exit (status) code. The value is returned to the calling program. It is not output to the screen. If you execute the command from a batch file then the batch file will receive the exit code so that you can do with it as you please. Its for programmers.

[Reply or follow-up to this message]

re: exit command status
Friday, December 5, 2008 at 9:16 am
Posted by jigneshjsoni (41 messages posted)

When a program calls a subroutine, if that subroutine runs successfully then code "0" is returned with the message, right ? If subrioutine does not run successfully, then non-zero value is returned with the error message. Calling program desplays the message but does not display the code, right ?


On Friday, December 5, 2008 at 8:27 am, appleoddity wrote:
>


>Its two different things. You're asking about a exit (status) code. The value is
>returned to the calling program. It is not output to the screen. If you execute
>the command from a batch file then the batch file will receive the exit code so that
>you can do with it as you please. Its for programmers.
>

[Reply or follow-up to this message]

re: exit command status
Friday, December 5, 2008 at 9:21 am
Posted by appleoddity (2369 messages posted)

Exactly. The calling program can interpret the error code as necessary. If that means displaying an "english" error message, then that is what happens.

[Reply or follow-up to this message]

Tip: Use one of the [Reply or follow-up to this message] links above to add a message to this thread
Return to the Windows Server 2003 Discussion Forum


All content at Annoyances.org is Copyright ©1995-2012 Creative Elementtm All rights reserved.
Please do not plagiarize; redistributing these pages without permission is strictly prohibited.