FileSystemObject.DeleteFile()

JScript3.0+syntax

							filesystemobject.DeleteFile(filename, force)

Description

The DeleteFile() method is used to delete an existing file. An instance of the FileSystemObject is created, which uses the DeleteFile() method to remove the file testing.txt. This method takes two parameters. The first parameter, filename, is a string specifying the name of the file to delete, while force is a Boolean value indicating whether a file that has read only permissions can be deleted.

Example

Listing 9.75 shows how to delete a file.

Listing 9.75 Example of DeleteFile()
 <html> <body> <script language="JScript"> <!-- Hide // function deletes the file "texting.txt" function deleteFile() { var myObject; // Create an instance ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.