Copy Method
Copy the specified file or folder from one location to another.
object.Copy destination[, overwrite]
parameter
object
Required option. Should beFileorFolderThe name of the object.
destination
Required option. Copy the destination location of the file or folder. Wildcards are not allowed.
overwrite
Optional. Boolean value. If you overwrite an existing file or folder, the Boolean value isTrue(Default); otherwiseFalse。
illustrate
The result of applying a Copy method to File or Folder is exactly the same as the action performed with or . In OR, use object to refer to a file or folder and pass the file or folder as a parameter to OR. However, it should be noted that the or method can copy multiple files or folders.
The following example showsCopyMethod usage:
Dim fso, MyFileSet fso = CreateObject("")Set MyFile = ("c:\", True)("
This is a test")
Set MyFile = ("c:\")
("c:\windows\desktop\")