How about to create an eventlog in a file for the script execution. For exemple, the command line would be :
%systemroot%\kix32 <script>.kix <%directory%eventlog>.log

And with this automation, it would be more easy to debug the script whithout to run the debug mode (/d)

for exemple, the eventlog file :
break on=ok;<error_code>
cls=ok;<error_code>
if exist("z:\")=ok;<error_code>
call "z:\kixtart.kix"=failed;<error_code>
***script exit because an error as occured