filesystemobject.CreateTextFile(filename, overwrite)
The CreateTextFile() method is used to create a new text file.
filename is the name of the file.
overwrite is a Boolean value indicating whether to overwrite an existing file.
<html>
<body>
<script language="JScript">
<!--
function createFile()
{
var myObject, newfile;
myObject = new ActiveXObject("Scripting.FileSystemObject");
newfile = myObject.CreateTextFile("c:\\testing.txt", false);
}
-->
</script>
Create Text file "testing.txt"
<form name="myForm">
<input type="Button" value="Click to Create New File" onClick='createFile()'>
</form>
</body>
</html>