You're capturing the successes, which are on STDOUT, but not the failures, which are on STDERR. You should be able to redirect STDERR to STDOUT so that you'll get it all by modifying one line to:
Code:
shell "%comspec% /c $RunGrpProgram > %%temp%%\mytempfile.txt 2>&1"



Joe