Folder.Copy()

JScript3.0+Syntax

							folder.Copy(destination)
							folder.Copy(destination, boolean)
						

Description

The Copy() method is used to copy a specified folder from one location to another. The destination specified is the location to which to copy the folder. If the boolean parameter is set to true, and if there is an existing folder in the destination location, the copy will overwrite the folder.

Example

Listing 9.97 creates an instance of the Folder object, and then makes a copy using the Copy() method. If the new folder already exists, it will be overwritten.

Listing 9.97 Using the Copy() Method
 // Create a FileSystemObject var myObject = new ActiveXObject("Scripting.FileSystemObject"); // Create a Folder object var myFolder = myObject.GetFolder("c:\Temp"); ...

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.