Page 1 of 1

Windows batch job _exit code

Posted: 04 Dec 2007 3:54
by Willys
Sorry, this is not a very complex question - I am just starting my implementation and the manual isn't clear.

Question on _exit code setting?
For setting up my batch job in windows -
Is it as simple as this:


@echo off
execute blah blah whatever
here I check if file exists, if not goto failure


rem Successful condition, file does exist
:success
_exit 0
rem this is a successful execution
goto end

rem Failure condition, file does not exist
:failure
_exit 1
rem this is a failure
goto end

:end

Posted: 06 Dec 2007 9:32
by kennedyk
Hi Willys,
So, what is the question?

Posted: 06 Dec 2007 4:08
by Willys
Sorry, I didn't make my question clear.

QUESTION: Is the code written above correct to pick up _exit code other than zero?

I sure would appreciate an example if my code is wrong.
I have a test job set up to fail and at a remote location I want it red flagged for notification.

I suspect ' _exit.exe ' isn't in the default path on my agent server.

I am very new to Control-M and appreciate this board, just much beyond my current level of understanding.

Posted: 07 Dec 2007 8:26
by rumbler75
Hi Willy,

that's a correct way to do it. Just make it sure that _exit.exe can be found the users path environments, usually C:\Program Files\BMC Software\CONTROL-M Agent\Default\EXE

Regards, Vilppu

Posted: 08 Dec 2007 4:56
by Willys
I have another related question ~

Is it necessary to have in the batch file the 'errorlevel' statement?

Windows Total Control

Posted: 02 Jul 2010 8:46
by linu1
Get preventive protection. Visit trustdownload. Windows Total Control

Posted: 10 Sep 2010 2:56
by dilin1984
Just din't get an idea what you were trying to say. How can this software help one ?