Data Type: FileSystemObject object
A FileSystemObject object.
Data Type: String
The name and path of the file or files to delete.
Data Type: Boolean
If set to
read-only flag on a file is ignored and the file deleted. Its
default value is
read-only files will not be deleted.
Permanently removes a given file or files.
FileSpec can contain wildcard
characters as the final path component, which allows multiple
files to be deleted.
FileSpec can be a relative or
If any of the files specified for deletion are open, the method fails with a “Permission Denied” error.
If the specified file or files can’t be found, the method fails.
If only a filename is used in
FileSpec, the application’s current
drive and directory is assumed.
FileSpec specifies a path
not ending in a path separator, the method will fail without
generating an error. If
specifies a path that ends in a path separator, the method fails
and generates runtime error 53, “File not found.”
The DeleteFile method differs from the Delete method of the File object in several respects. First, it allows you to delete a file directly, without first obtaining an object reference to it. Second, by supporting wildcards, it allows you to delete multiple files at once.
If an error occurs while deleting more ...