Storage Tips: Check which application is preventing safe USB removal
Published Apr 10 2019 01:45 AM 715 Views
Iron Contributor
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 Logs
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.

Links
Enable SetupApi Logs in Server 2003, XP
Enable SetupApi Logs in Server 2008, Vista



Open Handlers
Oh.exe ( O pen H 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.

Links
Download Windows Server 2003 Resource Kit Tools
How to Use the OH Tool



Process Explorer
Process Explorer is an application that shows you information on which handlers or DLLs each process has opened.

Links
Download Process Explorer




More Information
Know which process has locked a file , by Ramesh Srinivasan, MVP
The case of the Mysterious Driver , by Mark Russinovich, MSFT
SetupApi Logging , MSDN documentation



[Updated, October 14th, 1:00 PM]
Read the thread in Microsoft Communities on USB safe removal:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.storage&...

Version history
Last update:
‎Apr 10 2019 01:45 AM
Updated by: