查过msdn了,但还是不懂CopyFolder Method
Recursively copies a folder from one location to another.object.CopyFolder source, destination[, overwrite] Arguments 
objectRequired. Always the name of a FileSystemObject.sourceRequired. Character string folder specification, which can include wildcard characters, for one or more folders to be copied.destinationRequired. Character string destination where the folder and subfolders from source are to be copied. Wildcard characters are not allowed. overwriteOptional. Boolean value that indicates if existing folders are to be overwritten. If True, files are overwritten; if False, they are not. The default is True. Res
  Wildcard characters can only be used in the last path component of the source argument. For example, you can use:   FileSystemObject.CopyFolder "c:\mydocuments\letters\*", "c:\tempfolder\"
But you can't use:   FileSystemObject.CopyFolder "c:\mydocuments\*\*", "c:\tempfolder\"
  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. Otherwise, destination is assumed to be the name of a folder to create. In either case, four things can happen when an individual folder is copied. .If destination does not exist, the source folder and all its contents gets copied. This is the usual case. 
.If destination is an existing file, an error occurs. 
如果目标文件存在,就会产生错误?????那overwrite=true有何用?如何捕获错误?
.If destination is a directory, an attempt is made to copy the folder and all its contents. If a file contained in source already exists in destination, an error occurs if overwrite is False. Otherwise, it will attempt to copy the file over the existing file. 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~我本就以为就是这样的,但为什么?
.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. 
  An error also occurs if a source using wildcard characters doesn't match any folders.  The CopyFolder method stops on the first error it encounters. No attempt is made to roll back any changes made before an error occurs. 

解决方案 »

  1.   


    知如何捕获错误了,
    err.number
    唉,居然没人理我.ft
      

  2.   

    >>Permission denied
    不是很明白???你有访问目录的权限吗?
      

  3.   

    to hydnoahark(诺亚方舟) 
    当然有,
    当目标文件已存在时就会发生那个错误.我是用笨笨的办法解决的.
    存在时,就把它删了,再复制
      

  4.   

    fs.copyfolder s,d ,true 不就行了???
    true参数指定覆盖目的文件(如果存在)
      

  5.   

    就是不行才奇怪,
    缺省就是true的,
    我也显式的用true,还是不行。
    看来是我的VB有问题还是我的系统有问题。