<!--
It is possible to do this using ActiveX embedded into your JavaScript
It works but it brings up a window asking if you want to run the script because it might be UNSAFE
-->
<html>
<head><Script language="JavaScript"><!--
function WriteToFile()
{ var filename = "data.txt";
var fso = new ActiveXObject("Scripting.FileSystemObject"

;
if (fso.FileExists(filename)) {
var a, ForAppending, file;
ForAppending = 8;
file = fs

penTextFile(filename, ForAppending, false);
file.WriteLine("Hello Again"

;
} else {
var file = fso.CreateTextFile(filename, true);
file.WriteLine("HELLO"

;
}
file.Close();
}
//-------------------------------------------------------
function ReadFromFile() {
var fso, a, ForReading; ForReading = 1;
fso = new ActiveXObject("Scripting.FileSystemObject"

;
file = fs

penTextFile(filename, ForReading, false);
var name = file.readline();
var password = file.readline();
file.Close();
}
//-------------------------------------------------------
-->
</Script>
<body>
<script>
WriteToFile();
</script>
</body>
</html>