Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP DeleteFolder Method

ASP DeleteFolder Method


FileSystemObject Reference Complete FileSystemObject object reference manual


The DeleteFolder method deletes one or more specified folders.

**Note:** If you try to delete a folder that does not exist, an error occurs.

Syntax

FileSystemObject.DeleteFolder(foldername[,force])

Parameters Description
foldername Required. The name of the folder(s) to delete (wildcards can be used).
force Optional. A Boolean value indicating whether read-only folders can be deleted. True indicates read-only folders are deleted; False indicates they are not. The default is False.

Example

<%

dim fs

set fs=Server.CreateObject("Scripting.FileSystemObject")

if fs.FolderExists("c:\temp") then

  fs.DeleteFolder("c:\temp")

end if

set fs=nothing

%>


FileSystemObject Reference Complete FileSystemObject object reference manual