title: How to get the return code from a batch/shell script that launched from C++ code
body: <p>We have a C++ program, sometimes this program need to execute a user defined batch/shell/ant script. We are not able to control how this script runs. Is there a way to get the return code from C++ program? </p>
  
  <p>Something like:
      exec a script.sh > status.tmp ?</p>
  
  <p>We need to support both Windows and Linux.</p>
  
  <p>Any ideas?</p>