- key = "张三,李四,王五,马八"
-
- Set oShell = CreateObject("Shell.Application")
- Set oFSO = CreateObject("Scripting.FileSystemObject")
- s = oFSO.GetParentFolderName(WScript.ScriptFullName)
- s = oShell.BrowseForFolder(0, "", &H10, s).Self.Path
- t = oFSO.BuildPath(s, "按页打印")
- If Not oFSO.FolderExists(t) Then oFSO.CreateFolder t
- key = Split(key, ",")
- For Each file In oFSO.GetFolder(s).Files
- fileName = oFSO.GetFileName(file.Path)
- For Each keyword In key
- If InStr(fileName, keyword) > 0 Then
- oFSO.MoveFile file.Path, oFSO.BuildPath(t, fileName)
- Exit For
- End If
- Next
- Next
复制代码
|