Search found 9 matches

by imyashy
02 Jan 2024 04:58
Forum: DOS Batch Forum
Topic: code in else statement not executing
Replies: 4
Views: 5880

Re: code in else statement not executing

Batcher - Many thanks for your help.

2. bat worked. Good to see I needed to change %errorlevel% to !errorlevel! towards the end.
by imyashy
31 Dec 2023 13:02
Forum: DOS Batch Forum
Topic: code in else statement not executing
Replies: 4
Views: 5880

code in else statement not executing

Hi people, I put this script together with the following logic: IF driver.inf is found output 'printer driver found' ELSE IF device instance id is found output 'reader ID found' ELSE 'reader id not found' The first portion of the script works fine however the script then outputs Echo Printer Driver ...
by imyashy
22 Dec 2023 16:24
Forum: DOS Batch Forum
Topic: identify all instance id's in output of pnputil and then sends remove-device command for each
Replies: 1
Views: 5567

identify all instance id's in output of pnputil and then sends remove-device command for each

Hi Gents, I'm looking for some help please. I need a batch script that identifies all instance id's using an output from pnputil and then removes the corresponding devices according to their instance id. I am using windows 10 and windows 11. 1. Run's pnputil /enum-devices /class "smartcardreader" Mi...
by imyashy
18 Dec 2023 08:44
Forum: DOS Batch Forum
Topic: Help designing a batch file to return driver information
Replies: 6
Views: 9525

Re: Help designing a batch file to return driver information

If by formatting you mean the indents - they don't matter. I switched the order of the 'Device Description' and ' Instance ID'. If this makes things difficult, happy to have Instance ID first and then Device Description. Essentially the expected results should return the attributes below. -Device De...
by imyashy
17 Dec 2023 17:49
Forum: DOS Batch Forum
Topic: Help designing a batch file to return driver information
Replies: 6
Views: 9525

Re: Help designing a batch file to return driver information

Compo, Apologies. That is correct, the answer you provided answers the original question. Thank you for that. I should have mentioned that I tested it in my reply. I'm sure I answered your questions on SO in the comments section of the post. I tested the scripts provided on stackOverflow. One of the...
by imyashy
17 Dec 2023 15:20
Forum: DOS Batch Forum
Topic: Batch file to delete .inf files from a ADMIN CMDprompt.
Replies: 7
Views: 10951

Re: Batch file to delete .inf files from a ADMIN CMDprompt.

Thank you Aacini. That works. Driver is found and then deleted. I wanted to keep this code in my toolbox too from Compo, and apply it to smart card readers but it doesn't work any I don't know why. I expected it to delete all smart card reader drivers on the machine but it doesn't. Not sure where it...
by imyashy
16 Dec 2023 17:39
Forum: DOS Batch Forum
Topic: Batch file to delete .inf files from a ADMIN CMDprompt.
Replies: 7
Views: 10951

Re: Batch file to delete .inf files from a ADMIN CMDprompt.

Hi, How can this script be adapted so that it deletes the driver oem##.inf package for the driver that contains 12/13/2016 1.0.0.2. Manually this would be done like so: -Open ADMIN CMD prompt. -Type: pnputil.exe -e (This shows all the .inf files from drivers installed) - Search through the list to i...
by imyashy
15 Dec 2023 16:40
Forum: DOS Batch Forum
Topic: Help designing a batch file to return driver information
Replies: 6
Views: 9525

Re: Help designing a batch file to return driver information

A start would be to pipe the output through findstr.exe. %SystemRoot%\System32\pnputil.exe /enum-devices /drivers /class SmartCardReader 2>NUL | %SystemRoot%\System32\findstr.exe /RIC:"^De" /C:"^ *Driver [NV]" /C:"^ *[OMP]" /C:"^$" Obviously this would include the Outranked drivers too, (I've kept ...
by imyashy
10 Dec 2023 17:34
Forum: DOS Batch Forum
Topic: Help designing a batch file to return driver information
Replies: 6
Views: 9525

Help designing a batch file to return driver information

Hi all, I'm looking to create a batch file that returns driver information about all connected devices in a specific device class. In this case smartcard readers. It should look through the results of 'pnputil /enum-devices /drivers /class "smartcardreader"' to find the 'Matching Drivers' attribute ...