Batch.exit The exit function is established to set ERRORLEVEL of the batch execution. Sample var batch = new Batch(); batch.exit(1); API CallingReturning Batch . exit ( level )Batch ParametersTypeDescription levelNumberAn integer for ERRORLEVEL.