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 » DeleteFile

Version: 2.0

Syntax:
object.DeleteFile file [,force]
force
The optional force parameter accepts a Boolean value - True allows files with read-only attributes to be deleted, while False (default) does not. Trying to delete a read-only file without setting force to True will return an error.
file
Receives a string containing the name of the file that will be deleted.

This method deletes a specified file or files (using wilcards).

Note that an error occurs if you try to delete a file that doesn't exist.

Examples

Code:
<%
dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
filesys.CreateTextFile("c:\somefile.txt", True
If filesys.FileExists("c:\somefile.txt") Then
filesys.DeleteFile "c:\somefile.txt"
Response.Write("File deleted")
End If
%>
Output:
"File deleted"