When delivering any software package containing a batch file, the result is always "Exit code 1 indicates possible error", even though the batch file runs fine when tested locally. The problem happens even with the most trivial batch files, that are verified not to contain any syntax errors, or reasons for exiting with code 1.
Here's what you might notice if the software delivery job check window is visible:
Here's what you'll see in DSM Explorer, showing the job failed with "Exit code 1 indicates possible error":
Here's a snippet from the SD Agent log on the target computer:
(Note: Some of the less relevant traces have been removed)
NOTIFY | Running SD job 1: Software Delivery Test Send Test [Visible] 1.0
INFO | Procedure to run Test.cmd
INFO | Checking procedure extensionINFO | There is no extension handler for the .cmd extension
INFO | Current directory should be C:\Program Files (x86)\CA\DSM\SD\tmp\activate\28C55EB4-3661-4231-BFAD-41F327DA48DA.itm\1.vol
INFO | Current directory is C:\Program Files (x86)\CA\DSM\SD\tmp\activate\28C55EB4-3661-4231-BFAD-41F327DA48DA.itm\1.vol
NOTIFY | GetBinaryType() failed
INFO | Execute:Test.cmd > C:\PROGRA~2\CA\DSM\Agent\units\00000001\usd\sdjexec\6E566A57-5BCD-4C73-AF58-5682FB4F1460.res, timeout:21600000ms
NOTIFY | SDjob 1 returns: 1 ExitCode: 1
NOTIFY | Execution not OK