复制代码 代码如下:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colFiles = objWMIService. _
ExecQuery("Select * from CIM_DataFile where Extension = 'mp3'")
For Each objFile in colFiles
Wscript.Echo objFile.Name
Next
将上面
ExecQuery("Select * from CIM_DataFile where Extension = 'mp3'")
一行中的MP3替换为别的就可以搜索别的文件了。
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colFiles = objWMIService. _
ExecQuery("Select * from CIM_DataFile where Extension = 'mp3'")
For Each objFile in colFiles
Wscript.Echo objFile.Name
Next
将上面
ExecQuery("Select * from CIM_DataFile where Extension = 'mp3'")
一行中的MP3替换为别的就可以搜索别的文件了。
参考链接:WMI Tasks: Files and Folders
原文:http://demon.tw/programming/vbs-wmi-search-file.html
标签:
VBS,WMI,搜索
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
内蒙古资源网 Copyright www.nmgbbs.com
暂无“VBS调用WMI实现搜索硬盘mp3文件”评论...