Folder.Delete()

JScript3.0+Syntax

							folder.Delete(boolean)

folder.Delete()

Description

The Delete() method of an instance of the Folder object is used to delete a specified folder. The optional boolean parameter the method takes will cause the method to delete all read-only files and folders in the folder if set to true.

Example

Listing 9.101 deletes the specified folder.

Listing 9.101 Using the Delete() Method
// Create a FileSystemObject object
var myObject = new ActiveXObject("Scripting.FileSystemObject");

// Create a Folder object
var myFolder = myObject.GetFolder("c:\Test");

// Delete the folder
myFolder.Delete();
						

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.