About code 1312: This happens when you run the script under the system account with ie. schedule (no userenvironment is defined when running as system).
Anybody else knows how to prevent kix32.exe from logging to the eventlog or how to tell kix it is running without a userenvironment? (with a undocumented command-line option).