标题: [问题求助] [已解决]vbs怎样处理多个文件类型? [打印本页]
作者: comicguests 时间: 2012-12-20 20:42 标题: [已解决]vbs怎样处理多个文件类型?
- Set FSO = CreateObject("Scripting.FileSystemObject")
- For Each File in FSO.GetFolder(".").Files
- Ext = FSO.GetExtensionName(File)
- If LCase(Ext) = "mkv" Then RenFiles
- Next
- MsgBox "OK"
-
- Sub RenFiles()
- Set Re = New RegExp
- Re.Pattern = "(^.*\[)(\d{2})(\].*$)"
- Re.Global = True
- File.Name = Re.Replace(File.Name,"$2") & ".mkv"
- End Sub
复制代码
以上是处理mkv的,可不可以同时处理MP4、ass、rmvb?
作者: apang 时间: 2012-12-20 21:15
本帖最后由 apang 于 2012-12-20 21:24 编辑
第4行:- If LCase(Ext) = "mkv" Or LCase(Ext) = "mp4" Or LCase(Ext) = "ass" Or LCase(Ext) = "rmvb" Then RenFiles
复制代码
第12行:- File.Name = Re.Replace(File.Name,"$2") & "." & Ext
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |