warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\inetpub\Websites\DevGuru\www\includes\common.inc(1762) : eval()'d code on line 1.

VBScript » FileSystemObject » CreateTextFile

Version: 2.0

object.CreateTextFile filename [,overwrite[, unicode]]
Receives a string containing the name of the new text file that will be created.
The optional overwrite parameter returns a Boolean value - True (the default) permits overwriting of existing files while False does not.
The optional parameter, unicode, is a Boolean. In this case, True creates a Unicode file and False (the default) creates an AscII file.

Creates a text file and returns a TextStreamObject that can then be used to write to and read from the file.


dim filesys, filetxt, getname, path
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.CreateTextFile("c:\somefile.txt", True)
path = filesys.GetAbsolutePathName("c:\somefile.txt")
getname = filesys.GetFileName(path)
filetxt.WriteLine("Your text goes here.")
If filesys.FileExists(path) Then
Response.Write ("Your file, '" getname "', has been created.")
End If
"Your file, 'somefile.txt', has been created."