Vbscript 在VBS中复制文件时出错

Vbscript 在VBS中复制文件时出错,vbscript,Vbscript,将尺寸名称更改为某物为尺寸名称: line 1 char 9 error expected end of statement code 800A0401 和Next fileinforomfolder,只需Next Dim FSO As Object Dim FromPath Dim ToPath Dim Fdate Dim FileInFromFolder ' *snip* FSO.getfolder(FromPath.Files)中的每个File

尺寸名称更改为某物
尺寸名称

line 1
char 9
error expected end of statement
code 800A0401
Next fileinforomfolder
,只需
Next

Dim FSO As Object
    Dim FromPath
    Dim ToPath
    Dim Fdate
    Dim FileInFromFolder

    ' *snip*
FSO.getfolder(FromPath.Files)中的每个FileInfoRomFolder的

Fdate=Int(fileinformfolder.DateLastModified)
'将文件从2006年10月1日复制到2006年11月1日

如果Fdate>=DateSerial(2006,10,1)并且Fdate是正确的,VBScript将不允许您将变量作为任何特定的数据类型。一切都是一个
变体
Dim FSO As Object
    Dim FromPath
    Dim ToPath
    Dim Fdate
    Dim FileInFromFolder

    ' *snip*
For Each FileInFromFolder In FSO.getfolder(FromPath).Files
    Fdate = Int(FileInFromFolder.DateLastModified)
    'Copy files from 1-Oct-2006 to 1-Nov-2006
    If Fdate >= DateSerial(2006, 10, 1) And Fdate <= DateSerial(2006, 11, 1) Then
        FileInFromFolder.Copy ToPath
    End If
Next