set fso=createobject("scripting.filesystemobject")
Set regEx = CreateObject ("VBScript.RegExp")
regEx.IgnoreCase = True
regEx.Global = True
filepath=fso.GetFolder(".").Path
For Each subFolder In fso.GetFolder(filepath).SubFolders
For Each file In fso.GetFolder(subFolder.path).files
regEx.Pattern = ".+\\|[^\\\u4e00-\u9fa5]+$"
if regEx.test(file) then
st=regEx.Replace(file,"")
if len(st)>0 then
st=subFolder.path & "\" & regEx.Replace(file,"")
If not fso.folderExists(st) Then
fso.Createfolder(st)
end if
fso.movefile file , st & "\"
end if
end if
next
Next
if len(st)>0 then 改成 if len(st)>0 and st<> "草图照片" then
-----------------------------------------------------------------------------------------------------
set fso=createobject("scripting.filesystemobject")
Set regEx = CreateObject ("VBScript.RegExp")
regEx.IgnoreCase = True
regEx.Global = True
filepath=fso.GetFolder(".").Path
For Each subFolder In fso.GetFolder(filepath).SubFolders
For Each file In fso.GetFolder(subFolder.path).files
regEx.Pattern = ".+\\|[^\\\u4e00-\u9fa5]+$"
if regEx.test(file) then
st=regEx.Replace(file,"")
if len(st)>0 and st<> "草图照片" then
st=subFolder.path & "\" & regEx.Replace(file,"")
If not fso.folderExists(st) Then
fso.Createfolder(st)
end if
fso.movefile file , st & "\"
end if
end if
next
Next
Set regEx = Nothing
Set fso = Nothing
msgbox "运行完成"