Looks you are on the right track. I am curious about your use of the Z: drive as a location for scripts. I would think that using @Lserver or other variable that uses a UNC instead of a drive letter would be preferable to me.

I would use something like:

for $x=1 to 15
$spaces = $spaces + chr(32)
next

instead of your very long line.
_________________________
Home page: http://www.kixhelp.com/hb/