VBScript » File » Delete

Version: 3.0

Syntax:
object.Delete [force]
force
This is a Boolean value. If it is true, the file will be deleted regardless of its read-only status.

The method used to delete the file relating to the specified File object.

Note that trying to delete a file that doesn't exist will cause an error.

Examples

Code:
<%
dim filesys, demofile
set filesys = CreateObject ("Scripting.FileSystemObject")
set demofile = filesys.CreateTextFile ("c:\somefile.txt", true)
set demofile = filesys.GetFile("c:\somefile.txt")
demofile.Delete
%>