Page 1 of 1 1
Topic Options
#14634 - 2001-11-26 11:13 PM Reporting error codes from Kix to a DOS script
C_Hadley Offline
Fresh Scripter

Registered: 2001-11-26
Posts: 5
Loc: Memphis, TN
I call Kix from within a batch file.

One of my scripts calls for a reboot on a very rare occasion. An error message to 'End Task' appears because the reboot command is currently within Kixtart.

I would like to move the reboot command to the DOS script with error level reporting if the reboot becomes necessary.

If I could exit Kixtart to go back to the DOS script and then perform a task based on the error code, my problems would be solved. Any advice for a novice scripter?

Top
#14635 - 2001-11-26 11:33 PM Re: Reporting error codes from Kix to a DOS script
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Welcome to the board..

Can you edit this info out of the Batch script re-save and continue on?

Or, do you want to remove this "on-the-fly?"

Thanks!

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#14636 - 2001-11-26 11:56 PM Re: Reporting error codes from Kix to a DOS script
C_Hadley Offline
Fresh Scripter

Registered: 2001-11-26
Posts: 5
Loc: Memphis, TN
Actually. I want an error code. I want it to flow something like this:
1. DOS batch file calls kix script from closest netlogon server
2. Kixtart does tasks
3. Kixtart sets reboot code to 1 (if necessary)
4. Kixtart exits and reports out the reboot error code. ex. QUIT $reboot
5. I want the DOS batch to pick up the error code and issue a shell shutdown command if necessary.

I hope that is a little more descriptive.

Top
#14637 - 2001-11-27 05:40 PM Re: Reporting error codes from Kix to a DOS script
C_Hadley Offline
Fresh Scripter

Registered: 2001-11-26
Posts: 5
Loc: Memphis, TN
How about this angle?
Does anyone know of a way to schedule but delay a reboot from within a kix script to allow kixtart and the login batch to finish before it executes?
That would avoid the big 'end task' box that my test scripts keep running into.

Top
#14638 - 2001-11-27 05:48 PM Re: Reporting error codes from Kix to a DOS script
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Hi, you can just do this:

BATCH

code:

KIX32 KIXSCRIPT

IF %ERRORLEVEL%==1 REBOOT


KIXSCRIPT

code:

? "hello, this is kix"
$REBOOT='1'

if $REBOOT='1'
EXIT 1
else
EXIT 0
endif


Any number after the EXIT will be returned as %ERRORLEVEL%

[ 27 November 2001: Message edited by: DrillSergeant ]

_________________________
The Code is out there

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 641 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.054 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org