Hello Grumple,
An example using Powershell instead of DOS.
$ErrorActionPreference = "SilentlyContinue"; &{ java -jar awrongjarname } ; $LastExitCode
Basically the idea is to run multiple command separated by a semicolon.
In my example I suppressed the error description because I only want to get the last exit code without the rest of the error (so you can check on it later).
Then you retrieve the return value using #global:psresult# that you can check in your step with a condtional IF CheckVar #global:psresult#
Using this technique you can run quickly commands using a kaseya step but without the need of uploading a File to the Agent while at the same time to be able to get the return value.
If you want to check if the command has failed itself "say you made a syntax error" you can also use this:
$?
Best Regards