DriveCleanup does what you could do manually in the Windows Device Manager or my means of DeviceCleanup, it removes all currently non present USB Storage Devices, Disks, CDROMs, Floppies, Storage Volumes and WPD devices from the device tree.
Furthermore it removes orphaned registry items related to these device types.
Started with parameter -T (like test) it shows which devices it would remove.
Started with admin privileges and without a parameter it does its job without further inquiry.
To remove certain types of devices there are the parameters -U -D -C -F -V -W and -R, see DeviceCleanup.txt.
Sample to remove abandoned registry entries only:
Under x64 editions of Windows only the included x64 version works.
Admin privileges are required for actual cleanup, without it switches into the test mode.
Since V1.0 it removes non-USB drives if they have a removal policy > 1 (EXPECT_ORDERLY_REMOVAL or EXPECT_SURPRISE_REMOVAL).
When started standalone it waits for a keystroke at the end. This can be skipped by param -n or by starting it minimized or hidden.