When windows detects a device on a USB port it runs the found new hardware
wizard and puts information in the registry. If I have a parade of devices
with unique serial numbers the registry grows and grows with clutter. The
problem is even worse when the devices are USB to serial devices that are
assigned the next available COM port as well. I have avoided the problem in
my test by not allowing the device to re-register with windows after
assigning a unique serial number. However if the device is re-tested it will
want to run the found new hardware wizard and add to the registry.
Again my question is how do I clean out the unwanted clutter from the
registry and clear COM ports tagged as in-use? It does not seem wise to just
guess at what registry values apply and start hacking with regedit.
Is there an elegant way to undo what the found new hardware wizard does?
Is there a place to find out what is changed in the registry if I have to do
it the hard way, (especially where COM ports are flagged as in-use)?
Patrick Keenan said:
Why would you expect Windows to know what devices you will not see again?
I know the devices are gone for good and I want to pass this gem of
knowledge on to windows to remove clutter and free consumed resources.
That would be a feature of the test software, which is telling Windows what
port to create. Windows is not dictating the port number, except for
blocking in-use ports.
Windows does indeed choose the next available port without asking any
advice. I can reassign the port to a lower number and ignore the warning but
mostly I want to be able to clean the clutter out that has already collected.
Properly designed software should remove the virtual port when it shuts
down. It should not orphan those ports.
You might consider contacting the publisher of the test software for a
solution, since it is the behavior of *that* software that you're asking
about, not Windows. Windows is just doing what it's told to do.
The problem I am having is independent of any software other than windows.
The port itself is not left open. The add hardware wizard leaves stuff in the
registry that I would like to clean out. Are the registry mods known only to
the author of the device driver?