Below code snippet is completely working fine on IE when it is embedded in an HTML document.
var fso = new ActiveXObject("Scripting.FileSystemObject"); // creating a Scripting FileSystemObject.
var fh = fso.CreateTextFile("data.xml", true); // creating a file handler variable which is pointing to the given file.
fh.WriteLine(str); // Writing str value to file through file handler variable.
fh.Close(); // closing the file handler object.
I have gone through google and could not identify what might gone wrong.
if some had come across the same scenario, pls throw some light on this.