I tried that, but it doesn't return the value...
In my Java app, I had System.exit(returnCode) and in the '.bat' file
I have
@echo off
java <myApp>
set returnCd=%?%
echo %returnCd
and it didn't return any value. What should I specify in set returnCd=%?% instead of ?