How within a batch file to check if command
start \"\" javaw -jar %~p0/example.jar
was successful or produced an error?
I want to u
Most commands/programs return a 0 on success and some other value, called errorlevel
, to signal an error.
You can check for this in you batch for example by:
call
if %ERRORLEVEL% == 0 goto :next
echo "Errors encountered during execution. Exited with status: %errorlevel%"
goto :endofscript
:next
echo "Doing the next thing"
:endofscript
echo "Script complete"