First published on TECHNET on Oct 14, 2008
If the issue is a veto on a query for removal, you can look for which application has the reference on SetupApi logs. Oh.exe, or Process Explorer may also help to identify the process that’s causing the lock.
SetupApi is a system component that device installation software can use to perform custom operations. By enabling SetupApi logs, you can check which process has a reference to the device.
andlers) is a command line tool that can be downloaded for free with Windows Server Resource Kit Tools. This command-line tool shows the handles of all open windows and information relating to a particular process, object type, or object name.