How to delete a directory

  • Johan007
  • Guru
  • Guru
  • User avatar
  • Posts: 1080
  • Loc: Aldershot, UK

Post 3+ Months Ago

Ok I want to delete my old forum from my webspace. Does anyone know where or how I can write a bit of ASP to delete the directory?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

The DeleteFolder method deletes one or more specified folders.

Note: An error will occur if you try to delete a folder that does not exist.

Syntax
FileSystemObject.DeleteFolder(foldername[,force])

Parameter Description
foldername Required. The name of the folder or folders to delete (Wildcards are allowed)
force Optional. A Boolean value that indicates whether read-only folders will be deleted. True indicates that read-only folders will be deleted, False indicates that they will not be deleted. Default is False

Code: [ Select ]
Example
<%
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FolderExists("c:\temp") then
 fs.DeleteFolder("c:\temp")
end if
set fs=nothing
%>
  1. Example
  2. <%
  3. dim fs
  4. set fs=Server.CreateObject("Scripting.FileSystemObject")
  5. if fs.FolderExists("c:\temp") then
  6.  fs.DeleteFolder("c:\temp")
  7. end if
  8. set fs=nothing
  9. %>

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 49 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.