return value from exe

  • Thread starter Thread starter John Goche
  • Start date Start date
J

John Goche

Hello,

I would like to inspect the exit value of an exe launched from a DOS
prompt. This is the return value as in the 0 in the following C
program:

int main()
{
return 0;
}

On unix one can enter "eacho $?" at the shell prompt to retrieve this
value after the exe completed. Is there a way to do the same thing
from DOS?

Thanks,

JG
 
You could use a batch file to lauch the exe and catch the return value with
errorlevel. I am not very proficient with batch files but if you go to the
page below and click on "Batch files" then "Errorlevels", you may find what
you need. You could also do this with a scripting language like Python.
http://www.robvanderwoude.com/index.html
www.python.org
Louis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top