August 1999
Intermediate to advanced
1488 pages
72h 53m
English
file.Copy(destination, overwrite)
The Copy() method is used to copy a specified file from one location to another. This method takes two parameters. destination is the location to which to copy the file. overwrite is a Boolean value indicating whether to overwrite an existing file of the same name.
Listing 9.51 shows how to use the Copy() method to copy the test.txt file to mytest.txt.
<html> <BODY> <script language="JScript"> <!-- Hide // function creates a new file object and then copies it to // another file. function copy() { var myObject, f; //Create an instance of the FileSystemObject myObject = new ActiveXObject("Scripting.FileSystemObject"); f = myObject.file.copy("c:\\test.txt", ... |
Read now
Unlock full access