本帖最后由 chamlien 于 2016-3-29 11:06 编辑 Local $f, $shell, $s, $i, $title='该文件标题不含有_'
$file = "E:\My File\Music\神武雨霖铃 - 阿悄.mp3" ;文件路径
$o = ObjCreate("scripting.filesystemobject")
$f = $o.GetFile($file)
$shell1 = ObjCreate("Shell.Application")
$shell = $shell1.Namespace($f.ParentFolder.Path)
;$i=22
For $i = 0 To 30
$s = $shell.GetDetailsOf(0, $i) & " " & $shell.GetDetailsOf($shell.Items.Item($f.Name), $i)
If StringInStr($s, "标题") And StringInStr($s, "_") Then
$title = StringRegExp($s, '\标题 (.+?)\_', 3)
$title = $title[0]
ExitLoop
EndIf
If StringInStr($s, "title") And StringInStr($s, "_") Then
$title = StringRegExp($s, '\title (.+?)\_', 3)
$title = $title[0]
ExitLoop
EndIf
Next
$o = 0
$shell1 = 0
MsgBox(0, "", $title)
以上代码搜索了论坛,然后修改一下别人的代码达到了你想要的结果。
至于批量读取文件然后遍历,这个就要你来完成了。 |