If it errors with unknown command at WriteLog, then either you do not have the WriteLog UDF in your script or you have an error calling it if it is an external file.

This type of error can also be caused by a misplaced quote elswhere in the script. The effect of that is to cause parts of the code no in a string to be considered to be part of a string thus missing some of the command constructs.
_________________________
Home page: http://www.kixhelp.com/hb/