METHOD:  FileSystemObject.DeleteFolder

object.DeleteFolder folder [, force]

This method is used to delete a specified folder or folders (using wildcards), including all of it's subfolders and files. The optional force parameter returns a Boolean value - True allows folders with read-only attributes to be deleted, while False (default) does not.

Note that an error also occurs if you try to delete a folder that doesn't exist.

Code:
<%
dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesysFolderExists("c:\DevGuru\website\") Then 
   filesysDeleteFolder "c:\DevGuru\website\"
   Response.Write("Folder deleted")
End If
%>

Output:
"Folder deleted"

Copyright 1999 by Infinite Software Solutions, Inc.
Trademark Information