Get the App
SLTechnology News&Howtos  ›  Development  › 

How to call WMI to search hard disk mp3 files by VBS

Shulou Source: shulou.com Published: 2022-06-03 08:39:21 11月15日 Update

This article is about how VBS calls WMI to search hard disk mp3 files. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

The code is as follows:

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

above was

ExecQuery("Select * from CIM_DataFile where Extension = 'mp3'")

MP3 in a row can be replaced by other search files.

Thank you for reading! About "VBS how to call WMI to search hard disk mp3 files" This article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!

Tags: Files search hard disk content more articles good practical one line code articles read knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MySQL Docker Shulou Tech Info Redmi