<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> <script LANGUAGE="JavaScript"> function CreateFile(){ var fso, tf; fso = new ActiveXObject("Scripting.FileSystemObject"); tf = fso.CreateTextFile("c:\\javafile.txt", true); // Write a line with a newline character. tf.WriteLine("Testing 1, 2, 3.") ; // Write three newline characters to the file. tf.WriteBlankLines(3) ; // Write a line. tf.Write ("This is a test."); tf.Close(); } </script> <script LANGUAGE="VBScript"> Sub CreateFile2() Dim fso, tf Set fso = CreateObject("Scripting.FileSystemObject") Set tf = fso.CreateTextFile("c:\vbFile.txt", True) ' Write a line with a newline character. tf.WriteLine("Testing 1, 2, 3.") ' Write three newline characters to the file. tf.WriteBlankLines(3) ' Write a line. tf.Write ("This is a test.") tf.Close End Sub </script> </head> <body> <form action="" method="POST"> <INPUT TYPE=BUTTON VALUE="Click me" NAME="BtnHello" OnClick="CreateFile()"> <br> <INPUT TYPE=BUTTON VALUE="Click me 2" NAME="BtnHello2" OnClick="CreateFile2()"> </form> </body> </html>