ASP DeleteFile Method
The DeleteFile method deletes one or more specified files.
Syntax
FileSystemObject.DeleteFile(filename[,force])
Parameter Description
filename - Required. The name of the file or files to delete (Wildcards are allowed)
force - Optional. A Boolean value that indicates whether read-only files will be deleted. True indicates that the read-only files will be deleted, False indicates that they will not be deleted. Default is False
Example
<%
dim fso
Set fso=Server.CreateObject(”Scripting.FileSystemObject”)
fso.CreateTextFile(”c:\file1.txt”,True)
if fso.FileExists(”c:\file1.txt”) then
fso.DeleteFile(”c:\file1.txt”)
end if
set fso=nothing
%>
