FileSystemObject.CopyFile()

JScript3.0+Syntax

							filesystemobject.CopyFile(source, destination, overwrite)

Description

The CopyFile() method is used to copy one or more files to a specified directory. This method takes three parameters. The first parameter, source, is a string specifying source path and filename from which to copy. The second parameter, destination, is a string specifying destination path a filename to which to copy. The final parameter, overwrite, is a Boolean value indicating whether to overwrite an existing file or not.

Example

Listing 9.71 shows how to copy a file from one location to another.

Listing 9.71 Example of CopyFile()
 <html> <body> <script language="JScript"> <!-- Hide function copy() { var myObject, newpath; ...

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.