I have an output text file the contains hundreds of lines like the below code example:
I have few Instance ID names that I am looking for, and I want to delete using a tool called PNPTIL.EXE the corresponding inf file like the following command: pnputil /delete-driver oem1.inf /force
So for example, if my list contains ACPIINT33D35&2890d699&0, then I would want to run
pnputil /delete-driver msgpiowin32.inf /force
I only want to delete the inf file that corresponds to my list and leave the other files intact.
Any help is highly appreciated
Instance ID: ACPIINT33D35&2890d699&0
Device Description: GPIO Laptop or Slate Indicator Driver
Class Name: HIDClass
Class GUID: {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
Manufacturer Name: Microsoft
Status: Started
Driver Name: msgpiowin32.inf
Instance ID: USBSTORDisk&Ven__USB&Prod__SanDisk_3.2Gen1&Rev_1.001012c724a66062eb91a98f313fac41504ae5f57e520c7522337f0fc4ac56dd
Device Description: USB SanDisk 3.2Gen1 USB Device
Class Name: DiskDrive
Class GUID: {4d36e967-e325-11ce-bfc1-08002be10318}
Manufacturer Name: (Standard disk drives)
Status: Disconnected
Driver Name: disk.inf
Instance ID: BTHENUM{0000110b-0000-1000-8000-00805f9b34fb}_LOCALMFG&00027&25d7cd33&0&08C8C2697FC2_C00000000
Device Description: Jabra Evolve2 75
Class Name: MEDIA
Class GUID: {4d36e96c-e325-11ce-bfc1-08002be10318}
Manufacturer Name: Microsoft
Status: Disconnected
Driver Name: microsoft_bluetooth_a2dp_src.inf
I tried to script it with the command line with no luck. I am not an expert in PowerShell, and if there is a solution in PowerShell that would also be great.
Anoni Mouse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.