troubleshooting Question

VB6 - CMD search from VB6 application

Avatar of Wilder1626
Wilder1626Flag for Canada asked on
Visual Basic Classic
4 Comments1 Solution72 ViewsLast Modified:
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
    

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
ASKER CERTIFIED SOLUTION
Arana (G.P.)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros