Open In App

ASP DeleteFolder Method

The ASP DeleteFolder Method is used to delete one or more folders from the server. It returns an error if we want to delete a non-existing folder.  

Syntax:



FileSystemObject.DeleteFolder(foldername[,force])

Parameter Values:

Example: Below example demonstrates the DeleteFolder Method.  






<%
dim gfg
set gfg=Server.CreateObject("Scripting.FileSystemObject")
if gfg.FolderExists("C:\Folder2\B") then
 gfg.DeleteFolder("C:\Folder2\B")
 response.write("Folder is Deleted")
end if
set gfg=nothing
%>

Output:

Folder is Deleted
Article Tags :