How to remove all previous devices in xp?
Try USBDeview from NirSoft. From the website:
"USBDeview is a small utility that lists all USB devices that currently connected to your computer, as well as all USB devices that you previously used. For each USB device, exteneded information is displayed: Device name/description, device type, serial number (for mass storage devices), the date/time that device was added, VendorID, ProductID, and more... USBDeview also allows you to uninstall USB devices that you previously used, and disconnect USB devices that are currently connected to your computer. You can also use USBDeview on a remote computer, as long as you login to that computer with admin user."
The interface supports sorting and multiple select and remove. Download here
Microsoft has a command line utility called DevCon which may do what you need.
List present and non-present USB devices:
devcon findall =usb
Remove all USB devices:
devcon remove @usb\*
Proceed with caution. You might need to do a devcon rescan
or even a devcon reboot
afterwards.