![]() ![]() The CopyFolder method stops on the first error it encounters. ![]() If destination is a read-only directory, an error occurs if an attempt is made to copy an existing read-only file into that directory and overwrite is False.Īn error also occurs if a source using wildcard characters doesn't match any folders. Otherwise, it will attempt to copy the file over the existing file. If a file contained in source already exists in destination, an error occurs if overwrite is False. If destination is a directory, an attempt is made to copy the folder and all its contents. If destination is an existing file, an error occurs. If destination does not exist, the source folder and all its contents gets copied. In either case, four things can happen when an individual folder is copied: Otherwise, destination is assumed to be the name of a folder to create. If source contains wildcard characters, or destination ends with a path separator (), it is assumed that destination is an existing folder in which to copy matching folders and subfolders. For example, you can use: FileSystemObject.CopyFolder "c:\mydocuments\letters\*", "c:\tempfolder\"īut you can't use: FileSystemObject.CopyFolder "c:\mydocuments\*\*", "c:\tempfolder\" Wildcard characters can only be used in the last path component of the source argument. If True, files are overwritten if False, they are not. Boolean value that indicates if existing folders are to be overwritten. Character string destination where the folder and subfolders from source are to be copied. Character string folder specification, which can include wildcard characters, for one or more folders to be copied. The CopyFolder method syntax has these parts: Part Recursively copies a folder from one location to another.
0 Comments
Leave a Reply. |