Post your modifications up to this point (the whole script please). At this point so many suggestions have been made, we need to see exactly where you are.
Also let us know exactly what the script is doing and at what point.
If you are unsure of what is going on or causing the exit, on the command line add the parameter '/d' (no quotes), and this will allow you to step through the script and see what it is doing along the way.
See these manual pages for more information -
[Running KiXtart] http://www.kixtart.org/manual/Notes/RUNNING.htm
[Debug How To] http://www.kixtart.org/manual/Commands/Debug.htm
_________________________
Today is the tomorrow you worried about yesterday.