Author Topic: How to remove all devices of a given VID  (Read 3687 times)

bpaddock

  • Frequent Contributor
  • ****
  • Posts: 66
How to remove all devices of a given VID
« on: July 26, 2018, 09:23:02 am »
I know this question is from 2013, however it still comes up when doing USB device development.

"Is there radical way to remove all of the key in the windows registers..."

Here is a batch file that will remove all devices of a particular VID, in this example FTDI:

@echo off
set PGM=devcon
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" set PGM=devcon64
@echo Using %PGM% to remove any FTDI USB devices (If none listed, none were removed):
FOR /F "tokens=1 delims=: " %%A IN ('%PGM% FindAll * ^| FIND /I "VID_0403"') DO (
 %PGM% Remove "@%%~A"
)
pause

Needs DEVCON(64):

https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon

It is possible to use DEVCON to remove ALL USB devices, which seems reasonable during development,
until it has removed your mouse and keyboard...  You have been warned. :-/


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How to remove all devices of a given VID
« Reply #1 on: July 26, 2018, 10:02:54 am »
Thank you for this useful tool + warning!