Windows batch job _exit code

Several scripts
Post Reply
User avatar
Willys
Nouveau
Nouveau
Posts: 8
Joined: 03 Dec 2007 12:00
Location: USA

Windows batch job _exit code

Post by Willys » 04 Dec 2007 3:54

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
Last edited by Willys on 07 Dec 2007 2:48, edited 1 time in total.
Image
willys@wowmail.com
_________________

kennedyk

Post by kennedyk » 06 Dec 2007 9:32

Hi Willys,
So, what is the question?

User avatar
Willys
Nouveau
Nouveau
Posts: 8
Joined: 03 Dec 2007 12:00
Location: USA

Post by Willys » 06 Dec 2007 4:08

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.
Image
willys@wowmail.com
_________________

User avatar
rumbler75
Nouveau
Nouveau
Posts: 22
Joined: 16 Oct 2006 12:00
Location: Helsinki

Post by rumbler75 » 07 Dec 2007 8:26

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

User avatar
Willys
Nouveau
Nouveau
Posts: 8
Joined: 03 Dec 2007 12:00
Location: USA

Post by Willys » 08 Dec 2007 4:56

I have another related question ~

Is it necessary to have in the batch file the 'errorlevel' statement?
Image
willys@wowmail.com
_________________

User avatar
linu1
Nouveau
Nouveau
Posts: 1
Joined: 02 Jul 2010 12:00

Windows Total Control

Post by linu1 » 02 Jul 2010 8:46

Get preventive protection. Visit trustdownload. Windows Total Control

User avatar
dilin1984
Nouveau
Nouveau
Posts: 1
Joined: 10 Sep 2010 12:00

Post by dilin1984 » 10 Sep 2010 2:56

Just din't get an idea what you were trying to say. How can this software help one ?

Post Reply