
Remove all devices not used for 1 year or more (m - month, d - days, i - minutes) Remove all non present devices whose device class is Media Remove all bluetooth devices but not COM9 and COM10ĭeviceCleanupCmd BTH* -e:"* (COM9)" -e:"* (COM10)" Remove all devices whose device IDs contain VID_045E

Remove all devices whose device IDs begin with HID\VID_045E Patterns are device IDs, device classes or friendly names. m:age minimum 'age' (last use of the device must be at least that old) s skip creation of a system restore point This is the command line version of DeviceCleanup, see above.ĭeviceCleanupCmd pattern1 Non-PnP devices and 'soft' devices are not listed by default, this can be changed in the Options menu.ĭevice Cleanup Cmd V1.2.0 - removes non-present devices from the Windows device management Under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum, on some Windows this seems to be set on boot or any other time.

The 'last used' time comes from the write time of the device's registry key With this tool you can delete multiple or all non-present devices. By means of the Windows device manager you can delete one by one only. Which both are quite missleading here since it's a privilege issue.ĭevice Cleanup Tool V1.2.1 - removes non-present devices from the Windows device managementĮach once attached device leaves an entry in the Windows device management. With ERROR_NOT_SUPPORTED or since Win10 version 1903 with ERROR_GEN_FAILURE, Without admin privileges it fails as under Vista and Win7 Since Windows 8 it works again but in contrast to XP admin privilegesĪre required.

Under Vista and Windows 7 it is no more supported by the Windows standardĭrivers, it always fails with ERROR_NOT_SUPPORTED. The function is available under XP but usually only for hubs which run with the If there really is a power-cycle performed then it must be very short. IOCTL_USB_HUB_CYCLE_PORT which, Microsoft says, power-cycles the USB port and thus initiates a re-enumeration of the attached device. Otherwise the command processor interprets the & char as separator for two separate commands.Īdmin rights are required under Win 8 and 10 (or an active USBDLM command interface).ģ - given ID not found or no device is attached to the port

If the & char is used in a parameter then, if started from a command-prompt or a BAT/CMD file, the whole parameter must be enclosed by quotation marks. RestartUsbPort Ī device instance ID (in quotation marks because it contains the & char)Ī friendly device name (in quotation marks if it contains space or &) RestartUsbPort V1.0.3 - Restarts a USB port I don't ask for donations but some users insist, so: offer for download by means of a "downloader" software include on CD/DVD of computer magazines include in software products, including commercial usage in any environment, including commercial All tools on this page work under Windows 2000 and higher.
