A me funziona perfettamente... ovviamente sostituendo il parameetro nella giusta posizione e aggiornando il loop...
ciaocodice:<script> function visfile() { var j var objfile=new ActiveXObject("Scripting.FileSystemObject"); var pathfile=objfile.OpenTextFile("C:\\trash\\pippo.txt",1); document.write("1^ lettura "); for (j=1; j<=6; j++) { var s=pathfile.ReadLine(); document.write(s); document.write(" "); } pathfile.close(); var pathfile2=objfile.OpenTextFile("C:\\trash\\pippo.txt",8); var s=pathfile2.WriteLine("mucca"); pathfile2.close(); var pathfile3=objfile.OpenTextFile("C:\\trash\\pippo.txt",1); document.write("2^ lettura "); for (j=1; j<=7; j++) { var s=pathfile3.ReadLine(); document.write(s); document.write(" "); } pathfile3.close(); } visfile() </script>