Both Win32_PnPEntity and Win32_PnPSignedDriver don’t have methods to uninstall/remove/delete a driver.
Is there a way to do it anyway? Maybe using another class? Or maybe a different object than winmgmts?
Examples of how to find a certain driver (before uninstalling it):
In VBScript:
<code>Set objWMIService = GetObject("winmgmts:\.rootcimv2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity WHERE Name = '" & deviceName & "'")
For Each objItem In colItems
Exit For
Next
colItems = objItem
</code>
<code>Set objWMIService = GetObject("winmgmts:\.rootcimv2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity WHERE Name = '" & deviceName & "'")
For Each objItem In colItems
Exit For
Next
colItems = objItem
</code>
Set objWMIService = GetObject("winmgmts:\.rootcimv2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity WHERE Name = '" & deviceName & "'")
For Each objItem In colItems
Exit For
Next
colItems = objItem
In AutoIt:
<code>Local $deviceName = "..."
Local $objWMIService = ObjGet("winmgmts:\.rootcimv2")
Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity WHERE Name = '" & $deviceName & "'").itemIndex(0)
</code>
<code>Local $deviceName = "..."
Local $objWMIService = ObjGet("winmgmts:\.rootcimv2")
Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity WHERE Name = '" & $deviceName & "'").itemIndex(0)
</code>
Local $deviceName = "..."
Local $objWMIService = ObjGet("winmgmts:\.rootcimv2")
Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity WHERE Name = '" & $deviceName & "'").itemIndex(0)
Note in Win32_PnPSignedDriver
it would be FriendlyName
instead of Name
.