Folder.Copy() (Method)

A method to copy folders.


JScript - 3.0
Internet Explorer - 4.0
JavaScript syntax:IEmyFolder.Copy(aTarget)
IEmyFolder.Copy(aTarget, aFlag)
Argument list:aTargetA valid path within the destination file system
aFlagA flag to indicate whether to overwrite an existing folder

Although you can copy whole folders from the file system via the FileSystem object's CopyFolder() method, this is a more fine-grain means of copying folders.

It is highly recommended that you choose one of the several alternative techniques for copying folders and stick to it. It is far less confusing that way.

This copy method is better than using the FileSystem.CopyFolder() method because it's clearer in the script that we are operating on a Folder. The other method appears ambiguous because we are operating on something contained in the file system and not the object directly. It feels instinctively better to be operating on objects directly rather than by proxy.

See also:File.Copy(), FileSystem.CopyFolder()