We help IT Professionals succeed at work.
Get Started

VB6 - CMD search from VB6 application

Wilder1626
Wilder1626 asked
on
69 Views
Last Modified: 2020-03-20
Hi

I have below code in my VB6 application where it search for : SELECT * FROM Win32_PnPSignedDriver where (FriendlyName like '% ANT %')

It works but not 100% doing what i want him to do.

 strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PnPSignedDriver where (FriendlyName like '% ANT %')", , 48)
    'Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PnPSignedDriver", , 48)
    For Each objItem In colItems
        Text = "DeviceID: " & objItem.DeviceID
     Text = Text & vbCrLf & "CompatID: " & objItem.CompatID
Text = Text & vbCrLf & "Description: " & objItem.Description
Text = Text & vbCrLf & "DeviceClass: " & objItem.DeviceClass
Text = Text & vbCrLf & "DeviceID: " & objItem.DeviceID
Text = Text & vbCrLf & "DeviceName: " & objItem.DeviceName
Text = Text & vbCrLf & "DevLoader: " & objItem.DevLoader
Text = Text & vbCrLf & "DriverDate: " & objItem.DriverDate
Text = Text & vbCrLf & "DriverName: " & objItem.DriverName
Text = Text & vbCrLf & "DriverVersion: " & objItem.DriverVersion
Text = Text & vbCrLf & "FriendlyName: " & objItem.FriendlyName
Text = Text & vbCrLf & "HardWareID: " & objItem.HardWareID
Text = Text & vbCrLf & "InfName: " & objItem.InfName
Text = Text & vbCrLf & "InstallDate: " & objItem.InstallDate
Text = Text & vbCrLf & "IsSigned: " & objItem.IsSigned
Text = Text & vbCrLf & "Location: " & objItem.Location
Text = Text & vbCrLf & "Manufacturer: " & objItem.Manufacturer
Text = Text & vbCrLf & "Name: " & objItem.Name
Text = Text & vbCrLf & "PDO: " & objItem.PDO
Text = Text & vbCrLf & "DriverProviderName: " & objItem.DriverProviderName
Text = Text & vbCrLf & "Signer: " & objItem.Signer
Text = Text & vbCrLf & "Started: " & objItem.Started
Text = Text & vbCrLf & "StartMode: " & objItem.StartMode
Text = Text & vbCrLf & "SystemName: " & objItem.SystemName
     
    Next
    

Open in new window


I would like the query to search anywhere in the Device Manager areas:
Device Manager
How can i do that?

Thanks again for your hep
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE