|
- Set FSO = CreateObject("Scripting.FileSystemObject")
- Set Ws = CreateObject("Wscript.Shell")
- For Each a In FSO.GetFolder(".").SubFolders
- XcopyFolder "^[a-z]{3}44\d{2}$"
- Next
- MsgBox "复制完成"
- Sub XcopyFolder(Pattern)
- Set Re = New RegExp
- Re.Global = True
- Re.IgnoreCase = True
- Re.Pattern = Pattern
- If Re.Execute(a.Name).Count > 0 Then
- Ws.Run "xcopy " & a.Name & "\* f:\aa" & a.Name & "\ /s",vbHide
- End If
- End Sub
复制代码
保存为test.vbs,与需要复制的文件夹放在同一位置 |
|