Often when you improperly disconnect devices from computer it leaves the tail of ghost device on your windows meaning every time when your windows startup it will display found new device and start looking for deriver and then throws an error “error installing device” .
This is most common with USB flash drives. By default Windows does not show ghosted devices. You can manually remove these ghost devices from device manager but here is much better way of removing ghosted devices.
The GhostBuster application is a small tool which enumerates all devices, detects ghosted devices and removes these if they match selectable devices types and / or devices classes with a single mouse-click.