I've done quite a bit of work with WSF's (using VBScript
mostly), and ColdFusion, so I'm hoping I can help here.
The behavior you're describing is pretty odd, and all I can
tell you is that it "smells" like a new-line related issue. I
noticed you're using the "fixnewline" attribute, is there a
specific reason for this? I would first try removing that attribute
(or set it to "no"), and see if the problem persists.
Secondly, have you tried buffering your output? Building a
file in the way that you are (write, append, append, append,
append...) isn't the most efficient way to approach it, and I've
experienced some quirky issues with ColdFusion in the past, where
multiple cffile (or cflog) in a row can result in some unreliable
results. (lines written to the file in the wrong order for example)
I would prefer you built the entire file-contents into a
single string var, and then write that string to disk in one round
trip, like so: