提示800A400c,能帮忙看下是哪里出问题吗?谢谢
Set fso = createobject("scripting.filesystemobject")
curdir = fso.getparentfoldername(wscript.scriptfullname)
fhtdir = fso.buildpath(curdir,"FHT")
fctdir = fso.buildpath(curdir,"FWZP")
dfcdir = fso.buildpath(curdir,"茶山村")
Set reg = createobject("vbscript.regexp")
reg.Global = False
reg.ignorecase = True
reg.multiline = False
movefiles fhtdir,dfcdir,"(\w{19})(\w{5})_FHT","房产分户图"
movefiles fctdir,dfcdir,"(\w{19})(\w{5})_FWZP","房屋照片"
msgbox "done!"
Sub MoveFiles(ByVal srcdir, ByVal destdir, ByVal strpattern, ByVal strsubdir)
reg.pattern = strpattern
For Each objfile In fso.getfolder(srcdir).files
strbasename = fso.getbasename(objfile.name)
If reg.test(strbasename) Then
Set objmatch = reg.execute(strbasename)(0)
part1 = objmatch.submatches(0)
part2 = objmatch.submatches(1)
dir1 = getmatchdir(destdir,part1)
If dir1 <> "" Then
dir2 = getmatchdir(dir1,part1 & part2)
If dir2 <> "" Then
dir3 = fso.buildpath(dir2,strsubdir)
Else
dir3 = fso.buildpath(dir1,strsubdir)
End If
If fso.folderexists(dir3) Then
objfile.move fso.buildpath(dir3,objfile.name)
End If
End If
End If
Next
End Sub
' 得到以指定名称开头的子文件夹路径;
Function GetMatchDir(ByVal pntdir, ByVal strbase)
For Each objdir In fso.getfolder(pntdir).subfolders
If Len(objdir.name) >= Len(strbase) Then
If StrComp(Left(objdir.name,Len(strbase)),strbase,1) = 0 Then
getmatchdir = objdir.path
Exit Function
End If
End If
Next
getmatchdir = ""
End Function