Tony Docherty wrote:
I don't know how Windows works in this regard, but in Linux, all the bourne family shells (and, I think, the C family shells) put the value of the last command executed will be in the ? variable
Windows always used to put the return code of the last command executed in an environment variable called ERRORLEVEL. I would imagine this behaviour hasn't changed although I haven't tried it since Win XP.
You can output the value from a command prompt as follows: