var FSO=new ActiveXObject("Scripting.FileSystemObject");
var curFileName="c:\test.txt";
try
{
var txt=FSO.OpenTextFile(curFileName,2,true);
txt.Write("What you want to write.");
txt.Close();
curFileContentChange=false;
}
catch(e)
{
alert("Error in opening and writing the file "+filename+" .);
}