Remove USB devices from the registry

When messing about with USB devices you can end up with a lot of junk in the registry. If you plug a device into different USB hub ports or, worse, have several of the same device attached at once things can get really bad.

If your devices don't have a unique serial number then Windows can't tell what devices it's seen before. The effect is that every time a device is plugged into a 'new' port, the driver will be re installed!

if, like me, you have a lot of USB hubs and devices (24+ here) your PC can get unstable and crash. When I moved to putting a unique serial number on my devices I hit a problem... Windown won't recognise the serial number if it has previously seen a device with the same VID, PID combination that did NOT have a valid serial number...

Again, that means needing to clear the registry:

First, unplug the USB devices then:

Run :
regedit.exe

Navigate to:
HKEY_Local_Machine -> System -> CurrentControlSet -> Enum -> USB

Now delete all the keys relating to the VID_PID combination you are using

If running Vista you may not have permissions to delete the keys...

Download "psexec.exe" (allows you to run a system level process):
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Open an elevated command prompt:
Find cmd.exe in your start menu (search on 'cmd' if you can't find it)
Right click and select 'run as administrator'

Use psexec to run regedit:
psexec.exe -s -i regedit.exe

No repeat the steps above to delete the keys and all should be better!

Comments

Popular posts from this blog

JTAG Progromming on a PIC

Using Plink.exe from C# (accessing a linux PC)

Evohome problems on Danfoss RAS-C2 valves