Get rid of ghost devices in windows

Windows had the bad habit of remembering what used to be installed on a PC. This can sometimes cause confusion because you get multiple choices for a single device, i.e. I have a scanner that every time it gets plugged into a different USB port it creates a new device for it so that when I go to scan something I have to first figure out which device is currently active, a bother. there is a solution for this though, add the following environment variable to your system:
and set its value to 1.
Now open the device manage and choose show hidden devices. Now when looking through the lists of devices you will find greyed out ones, these are the ones that are no longer on the system but the driver still present. Get rid of the ones that will not be needed again.
I read about this in this techrepublic article.