Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript Folders Collection Add Method

Adds a new Folder to a Folders collection.

Syntax: JScript Folders Collection Add Method

object.Add (folderName)

Arguments: JScript Folders Collection Add Method

object

The name of a Folders collection. Required.

folderName

The name of the new Folder object being added. Required.

Remarks: JScript Folders Collection Add Method

The following example illustrates the use of the Add method to create a new folder:

function AddNewFolder(path, folderName)

{

var fs, f, fc, nf;

fs = new ActiveXObject("Scripting.FileSystemObject");

f = fs.GetFolder(path);

fc = f.SubFolders;

if (folderName != "" )

nf = fc.Add(folderName);

else

nf = fc.Add("New Folder");

}

An error occurs if the folderName already exists.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.