I'm unable to capture the correct exit status of dscmdexport.exe in a Windows batch file. I searched this forum and found a lot of posts but it wasn't helpful.
Below is my code. Irrespective of failure or success ERRORLEVEL value is set to 0 and both "Success" and "Fail" lines are echoed.
Code: Select all
@echo off
echo "Export started"
C:\apps\ibm\InformationServer\Clients\Classic\dscmdexport.exe /D=<domain>:<port> /H=<Host> /U=<Usrname> /P=<password> <Project>"C:\temp\DSX_Backup.dsx"
IF NOT ERRORLEVEL 0 GOTO Fail
echo "Success"
:Fail
echo "Fail"
Thanks for your time.