Some time ago, I got a 500 GB USB external drive. At last I could put all my photos in one place. I invested a considerable amount of time using
Beyond Compare (which I love) and its Picture Viewer plug-in to get the best version of all my digital photos in one place. Yippee!
That joy was not long-lived, though. I started seeing file error pop-ups from the system tray, and when I saw one that mentioned the MFT, I became alarmed. The Event Viewer showed delayed write failures.
I ran many, many chkdsks before I got a clean one on my C drive. It didn't take many runs to get a clean one on the USB drive. I surfed for a solution to the delayed write problem. The solution that looked best to me--connecting by some means other than the USB cable--wasn't an option. I stopped using the USB drive.
Time passed, and my PC needed to be reimaged. (I'll have to do another post about that.) I copied all the data I wanted to save to my friend Tim's 500 GB USB external drive. After recovering the factory image to my PC's hard drive, I copied certain files from the USB drive back to my C drive, and things looked good.
That is, things looked good until one night I left the external USB hard drive attached, restarted my computer, and let it go into standby. The next morning, I saw two delayed write failure messages for files on the USB drive. The Event Viewer showed that the errors occurred
before I logged into Windows.
To my surprise, the Event Viewer showed that the delayed write failures occurred not during the night but when I brought the computer out of standby. (Previously I had seen failures when I was doing large file transfers--moving lots of high-resolution photos.)
I decided that I would no longer allow the PC to go into standby with the USB drive attached. Tim had already come to the conclusion that it's best to
eject external firewire drives whenever they are not in use, after he had similar problems with a firewire connection while working on videos. I wanted to prevent accidentally letting my PC go into standby with the USB drive attached.
The first job was to find out how to detect that the external USB drive was attached. After looking at an
MSDN article, I decided to use the AUTORUN.INF file.
Wikipedia Autorun information also helped.
Next up was to figure out how to disable standby mode, which I normally want enabled. I think most PC users could use the powercfg.exe command line options to disable standby.
However, I have a Toshiba Portege M200, so that didn't work. I have to use the Toshiba Power Saver utility, which is a Control Panel applet. Some surfing revealed
how to run a Control Panel applet from the command line. Searching in C:\WINDOWS\system32, I found TPwrSave.cpl, which had the same icon as the Toshiba Power Saver utility.
(I installed
TweakUI, but I don't think it meets my needs for this.)
Putting these all together resulted in an AUTORUN.INF text file, containing the following, saved in the top-level directory of the external USB drive. (I hope you don't mind me tailoring to
my PC, Tim!)
[autorun]
;open=control.exe /TPwrSave.cpl
ShellExecute=control.exe /TPwrSave.cpl
Label=Tim's 500 GB USB External Drive
UseAutoPlay=1
I would have preferred that the power saver utility come up without having to cancel autoplay and select from the autoplay menu. I also wish I could have used a command line program rather than a GUI applet. I know there's more I could do, but I think I've spent enough time on this today.
If you have a better solution, or have something to add, please comment!