Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!rpi!uupsi!rodan!rodan.acs.syr.edu!jfbruno From: jfbruno@rodan.acs.syr.edu (John F. Bruno) Newsgroups: comp.sys.ibm.pc Subject: Can batch files return value to C program? Keywords: TurboC,Batch,ErrorLevel Message-ID: <2469@rodan.acs.syr.edu> Date: 16 Mar 90 18:44:48 GMT Sender: netnews@rodan.acs.syr.edu Reply-To: jfbruno@rodan.acs.syr.edu (John F. Bruno) Organization: Syracuse University, Syracuse, NY Lines: 10 I calling a batch file using the Turbo-C system() call. Is there a way to get the value of "ERRORLEVEL" upon returning to the Turbo-C program? system() is declared as an int, but it only returns 0 or -1, I believe it returns -1 only if it couldn't find COMMAND.COM (and maybe -1 if the batch file wasn't found, but I haven't tested it for that) I can't set an environment variable in the batch file because when I return to the calling program, that environment is gone. I'd appreciate any suggestions ---jb (jfbruno@rodan.acs.syr.edu)