Is there any way to have a standard exec return a value? I made a program that detects whether there is a network connection present or not and it is going to be called from within a Rexx or Dos command file.

pseudocode:

If NetCheck.exe returns 1 then do (set of commands)
else If NetCheck.exe returns 0 then do (another set of commands)

...so I would like to have NetCheck.exe simply return a value.