I have seen this when running SMSLS.bat and some other programs via the RUN command as well. The logon scipt window remains open until all programs called be SMSLS.BAT terminate. If the program is suppose to run after the logon script terminate this sometimes causes a problem.

Are you using RUN or SHELL to invoke your code? IF you are using SHELL try RUN. IF you are using RUN then utilize the RUNONCE key to launch your program.
_________________________
Home page: http://www.kixhelp.com/hb/