Folders.Add()

JScript3.0+Syntax

							folderscollection.Add(foldername)

Description

The Add() method of the Folders collection is used to add folders to the collection. This can be used to create new folders on the file system.

Example

Listing 9.115 creates a test folder inside the \temp folder on the file system. This script can be executed by using the Windows Scripting Host (wscript.exe or cscript.exe). Be sure you are on a drive that contains a folder named temp, and make sure there is no folder named test already present. Not doing so will result in an error.

Listing 9.115 Using the Add() Method of the Folders Collection
 // Create an instance of the FileSystemObject var myFileSysObj = new ActiveXObject("Scripting.FileSystemObject"); // ...

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.