What I’m looking to do is to report the exit code of a command line argument and was wondering if this is possible..
For example:
myProgram.exe aThirdPartyProgram.exe
and I want to get hold of the exit code of aThirdPartyProgram that is used within the myProgram. The reason for doing this is to create a batch file that can be used to test multiple pieces of software.
Unless
myProgram.exeoutputs or returns anything that has to do with the exit code ofaThirdPartyProgram.exe, then no, there isn’t a way. From your batch fileaThirdPartyProgram.exeis just an argument tomyProgram.exe; there is no indication whatsoever that it’s a program at all that is going to be executed. Furthermore,myProgram.exeruns the program, not your batch, so if it doesn’t tell you its exit code, then you’re out of luck.If
myProgramjust passes on the exit code ofaThirdPartyProgramyou can use the pseudo-variable%ERRORLEVEL%which contains the exit code of the last command.