RDiff.exe is supposed to Return %ERRORLEVEL%

RDiff.exe is supposed to Return %ERRORLEVEL% if it does not prepare a signature properly.
What I noticed is that if the Basis file changes in between creation of Signature it just aborts operation and produces an incomplete signature file.
Problem is that there is no Error indicator to catch this. How to trap this ?
Allan_FernandesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Colin_UKCommented:
Hi Allan,

To read the exit code of the last executed command in a Windows Batch file is to query the ERRORLEVEL.
Since Windows NT this has been made easier by using the %ERRORLEVEL% environment variable.

This little snippet shows the usage to get a programs exit code.
dir
echo Last code was %ERRORLEVEL%

Open in new window


In this case it should show 0, as no error will be likely.
You can do a simple IF, ELSE test and act accordingly in the event of non-success.

Hope this helps
Colin
0
Bill PrewCommented:
Try something like this and see if it helps, you can trap for failure of  RDIFF as well as ERRORLEVEL, not sure if this will work or not, can't test here.

RDIFF <parms> || (
    ECHO Errors running RDIFF
    SET RDIFFerr=Y
) && (
    IF %ERRORLEVEL% NEQ 0 (
        ECHO Error %ERRORLEVEL% running RDIFF
        SET RDIFFerr=Y
    ) ELSE (
    SET RDIFFerr=N
    )
)

IF "%RDIFFerr%" EQU "N" (
    REM Continue with logic for successful RDIFF
)

Open in new window


»bp
0
Allan_FernandesAuthor Commented:
> Problem is that there is no Error indicator to catch this
Thanks but that was not my question.
Anyways there is no way to Trap it, I cheked.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Allan_FernandesAuthor Commented:
...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.