在fso.CopyFile用这个试一下:
dd = "d:\scs\templates\test2\"

解决方案 »

  1.   

    老兄,你的代码没有错呀?为了这个我专门把你的代码拷贝在我的VB里运行了。
    我是在WIN2000专业版下试的。是不是你的系统有问题呢?还是你的VB有问题?
    你的代码我一个字也没有改。你再看看。我估计错误也许不在这里。
      

  2.   

    1、Sub CopyFile(Source As String, Destination As String, [OverWriteFiles As Boolean = True])
    2、fso.DeleteFile "d:\scs\templates\test2\test2" 
    ---你应该指出具体的文件名而不是*.*
      

  3.   

    另外,commond1中你参数顺序似乎反了。
      

  4.   

    Private Sub Command1_Click()
        Dim ss, dd As String
        Dim fso As New FileSystemObject
        dd = App.Path & "\tmp"
        ss = App.Path & "\test1\*.*"
        fso.CopyFile ss, dd, True
    End SubPrivate Sub Command2_Click()
        Dim ss, dd As String
        Dim fso As New FileSystemObject
        dd = App.Path & "\tmp\*.*"
        fso.DeleteFile dd, True
    End Subfso.DeleteFile dd, True
    这样能删除只读文件fso.CopyFile ss, dd, True
    能OVERWRITE文件
    但不能OVERWRITE只读文件