A SD Job which executes a command batch fails with error :
Exit code 255 indicates possible error [SDM228001]
<Please see attached file for image>
A .bat or .cmd file could generate an exit code 255 if it contains a line like this :
program1.exe | program2.exe
and program1.exe could not be executed successfully (it could not be found or it fails).
reg.exe query "HKLM\Software\ComputerAssociates\Unicenter ITRM\InstalledFeatures" /v "Agent" 2>NUL | find /I "14.0.1000" > NUL
If reg.exe is not found, script exits with exit code 255
Check that executable is working fine on target machine.
Make sure that executable could be found in a path set in PATH variable.
SD Job is executed under Local System Account and in some configuration, variable PATH may not contain some directories like %systemRoot% and %SystemRoot%\system32
If the path of executable is not in PATH variable in Local System environment, put the full path in command line :
fullpath/program1.exe | program2.exe
%Systemroot%\system32\reg.exe query "HKLM\Software\ComputerAssociates\Unicenter ITRM\InstalledFeatures" /v "Agent" 2>NUL | find /I "14.0.1000" > NUL
Another method :
Check if reg.exe could be found and if it could not be found add %SystemRoot%;%SystemRoot%\system32 and PATH variable :
reg.exe /? > nul 2>&1
IF ERRORLEVEL 9009 set PATH=%SystemRoot%;%SystemRoot%\system32;%PATH%