Why is my USB mouse disconnecting and reconnecting randomly and often?
Solution 1:
If you're experiencing mouse lockups or failures, it may be because your computer is automatically turning off the power to a USB Root Hub.
Go to your Control Panel > System > Hardware tab > and click on the "Device Manager" button.
In the Device Manager window, find the item or items labeled "Universal Serial Bus controllers." Open it, and double-click the first item called "USB Root Hub."
In the USB Root Hub Properties dialog, click on the "Power Management" tab.
"Allow the computer to turn off this device to save power" is checked by default. Uncheck this box, and click "OK."
If this does not work, do the same for the USB Input Device - uncheck the box "allow the computer to turn off this device to save power. (this worked for me) and stopped the annoying way the mouse would go in and out.
Solution 2:
Supposedly this can be caused by registry corruption:
This issue can occur when the device enumerator located at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet gets corrupted. As a result, the mouse attached to the USB controller is duplicated and the system gets confused. Periodical attemtps to remove the dupe are discarded after re-detecting the mouse attached to the controller.
That page recommends a system restore or uninstalling the USB device in Device Manager.
In addition to uninstalling the device itself, you can uninstall all the USB root hubs on your machine, and they will be reinstalled after a reboot, as recommended in this HP article USB devices are detected by Windows but are not working properly:
...
5.Double-click Universal Serial Bus Controllers to expand the list.
6.Right-click the first USB Root Hub in the list and then select Uninstall . Continue uninstalling all USB Root Hubs.
...
You can also uninstall all previous instances of the device (and the root hubs) using a tool like USBDeview. It will show you all devices that have ever been installed, even if they aren't currently plugged in, and you can uninstall them from there, so the "detected new hardware" thing will pop up the next time you plug it in. Sort them by vendor ID, select everything related to that product, right click, and uninstall them all.
I'm not sure if the registry corruption is truly the cause, and I'm not sure if this actually fixes it, but it's worth a try. It seems to be working for my most recent experience with this problem.