Well, although my overall opinion for Vista is kind of on the positive side, there are far too many things that I consider just BROKEN. One of those areas is the silly USB stick.
Before Vista, I used to plug it in, do my file copying with explorer, then do a safe removal and sure enough all explorer windows that were on that drive would close and the drive jet removed. PLUS the lights went OFF :-)
For some reason, God knows what, but I am sure that it has to be seriously valid at least technically, they decided to ruin the user experience and have us first close ALL explorer windows and then remove the drive.
Cool so far. And I am pretty certain many of you have seen the following dreaded dialog:
I am bloody sure that they could make it a BIT more useful and tell us WHICH programs are using the device, but then I guess this would probably require admin priviledges, so they didn't do it.
Anyway, on the message I particularly enjoy the "try again LATER" part. LATER? How much later? Like in a minute or so? I have actually seen in some other program an error message saying "try again in 1 minute" (I think it was Google Earth) and I found that even scarier, so I guess "later" is not that bad. Of course, they could just say "try again".
Anyway, I surely am not as wise as the Vista designers, so I should better keep my big mouth shut before someone sues me or my wife divorces me :-D
So here is the ULTRA tip, which comes straight from the horse's mouth! An MS developer in the Vista/Windows 7 "Devices Team".
When the dreaded dialog appears, then Vista does us all a big favour and adds entries to the event log, reporting which apps are using the device and preventing it from getting safely removed!!!
Oh yes...
All you have to do is open up event log viewer (Run ==> eventvwr.msc), go to Custom Views | Administrative Events and here's what you get (click on image to view in full size):
Yeap, it's explorer.exe that is preventing the device removal. In my case I also have a command prompt on that drive, so I had a second message as well for CMD.EXE. You will get one message for every process.
Note that the message even lists the process id, so that if you have many of the kind open you can easily locate which ones is causing the trouble. Just locate the pid in Task Manager and do a "switch to...". All really user friendly now, isn't it?
However, sometimes the event log message will report that the SYSTEM process is preventing device removal. In that case, there's nothing you can do other than:
(a) Try Again LATER and LATER and LATER until it gets removed (it eventually does...) OR
(b) To hell with the error message, just unplug the stick and hope for the best!
Now for those of you who like to do things the hardcore way, there is also a command line way to figure things out. First you must download the HANDLE tool from SYSINTERNALS.
Then open up a command shell and enter: HANDLE -a HardDiskVolume
You will get an output that looks like this (in my case I have two USB sticks attached):
Here I can see that the stick I am insterested in is actually HardDiskVolume7, so I can refine my search a little more to clean up the messy output.
If you feel kind of adventurous the you can try the -c option of HANDLE.EXE and close some handles in a really friendly way.
Have fun!
Dimitris Staikos



Many times, it is an index service that keeps a handle on the drive; it might be windows search, ms-office index, google desktop, whatever...
Unlocker might help, too:
http://ccollomb.free.fr/unlocker/
Posted by: Stazybο Hοrn | October 17, 2008 at 12:58 AM