HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

ASP DeleteFile Method


FileSystemObject Object Reference Complete FileSystemObject Object Reference

The DeleteFile method deletes one or more specified files.

Note: An error will occur if you try to delete a file that doesn't exist.

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 fs
Set fs=Server.CreateObject("Scripting.FileSystemObject")
fs.CreateTextFile("c:\test.txt",True)
if fs.FileExists("c:\test.txt") then
  fs.DeleteFile("c:\test.txt")
end if
set fs=nothing
%>


FileSystemObject Object Reference Complete FileSystemObject Object Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE