Set fso = createobject("scripting.filesystemobject") Set files= fso.getfolder("D:/vbs_test").files For Each f In files MsgBox f.type If f.type = "MP3 格式文件" Then MsgBox "找到了一个MP3文件"&chr(13)&chr(10)&"路径为:"&f.path&chr(13)&chr(10)&"文件名为:"&f.name End If Next set files = Nothing set fso = nothing