July 2000
Intermediate to advanced
492 pages
14h 53m
English
Delete (File Object, Folder Object) —
Obj
.Delete
blnForce
Deletes a file or folder.
blnForce
A Boolean value that indicates whether to delete files or folders, even if they are marked as read-only
<%
' Dimension local variables.
Dim fsoObject ' FileSystemObject
Dim filObject ' File Object
' Instantiate the FileSystemObject variable.
Set fsoObject = Server.CreateObject( _
"Scripting.FileSystemObject")
' Using the GetFile method of fsoObject, initialize the
' File object.
Set filObject = fsoObject.GetFile("d:\docs\test.txt")
' Delete the TEST.TXT file--even if the file is marked
' as read-only.
filObject.Delete True
. . . [additional code]
%>The Delete method of the File and Folder objects is functionally the same as the DeleteFile and DeleteFolder methods of the FileSystemObject object. If you use the Delete method of a Folder object, that folder and all of its contents will be deleted. The method will not warn you if you attempt to delete a directory that contains files.
Read now
Unlock full access