Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

On our computers, we use daily dozens of different usb drives from our customers.

This is bad because the registry hive is becoming huge as windows is so "smart" to save them forever

I set devmgr_show_nonpresent_devices=1 and i saw thousands of usb flash drives

There is a software that will automagically delete all previous devices?

Also this will solve a lot of problems with scanners and printers that will be seen as another device just because the user has plugged in another usb plug

share|improve this question
add comment

3 Answers 3

up vote 4 down vote accepted

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

share|improve this answer
    
wow this looks great!!! thank youuuuu!! NirSoft really rocks! –  Magnetic_dud Jun 18 '09 at 23:17
add comment

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.

share|improve this answer
    
Kind of a distructive answer without a reboot command thrown in there - since the system will be left in an unusable state... –  Kara Marfia Jun 17 '09 at 17:59
    
@Kara: For USB??? –  Dennis Williamson Jun 17 '09 at 18:24
    
Unusable from the console, I should say, as the devices will not redetect. ;) –  Kara Marfia Jun 25 '09 at 23:45
add comment

For storage volumes (USB drives) the Regisry Key is

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\STORAGE\Volume

A little testing revealed that Non present devices have '??' in the key name. One could write a simple program or script to cycle through the key names and delete the ones that have '??'.

share|improve this answer
    
\storage\ contains IDE/SATA drives, and yes, the non present devices have '??' in the name. But maybe the right one is \USBSTOR\? In this case, the non present devices have a normal name... –  Magnetic_dud Jun 17 '09 at 19:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.