wwwolf Posted April 20, 2015 Report Share Posted April 20, 2015 Does anyone know a good way to automaticly eject a USB hard drive after the transfer to it is complete? I used to use a small commandline tool and batch script that Retrospect would run after every job. That worked fine on my old Windows XP backup box, but doesn't seem to function with my new Windows 7 setup – it never releases the drive. Anybody have a solution to this in their own setup? 1 Quote Link to comment Share on other sites More sharing options...
rsleegers Posted April 21, 2015 Report Share Posted April 21, 2015 (edited) You could try devcon.exe. I use it to detach a removable SATA drive that has ST3500 in its name: devcon find ST3500* devcon disable ST3500* devcon remove ST3500* You may have to run as administrator, and I find I have to close Retrospect first to release its file handles or the removal says I need to restart. There is also RemoveDrive mentioned in this thread which i have used for USB drives, although it too can get stuck when a program hasn't released the drive or file/folder. Edited April 21, 2015 by rsleegers Quote Link to comment Share on other sites More sharing options...
wwwolf Posted April 23, 2015 Author Report Share Posted April 23, 2015 Thanks for the suggestion, rsleegers! I think I'm on the right track, but changes in the security model (and the addition of UAC) in Windows 7 is causing me headaches. I've managed to dig up my old retroeventhandler.vbs script. I'm not sure why the example scripts don't appear to be included in Retrospect 10, but they are still called. The long story short is that I have a line that calls: WshShell.Run """C:\Program Files\RemoveDrive\RemoveDrive"" e:" The request executes, but RemoveDrive fails to eject the drive. So far my testing has shown that I can reproduce this error when I launch the script as a normal user, but an elevated user executes as it should. This is particularly confusing as Retrospect runs as an elevated user, so I'd expect it to launch its scripts as such. In any event, I've given up doing it the fancy way for the moment and just placed the call to RemoveDrive as a scheduled task. My backups are predictable enough that should work for now. Quote Link to comment Share on other sites More sharing options...
Scillonian Posted April 23, 2015 Report Share Posted April 23, 2015 If you enable the 'Quick Removal' option for the USB drive (not having a USB drive to hand can't say exactly where the setting is) you should be able to unplug the drive without first having to eject it. By default this option is disabled to improve write performance hence the usual need to eject the drive to clear the write cache. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.